fix(techdocs-cli): config file for development build
Signed-off-by: Camila Belo <camilaibs@gmail.com>
This commit is contained in:
@@ -22,6 +22,7 @@
|
||||
"scripts": {
|
||||
"start": "nodemon --",
|
||||
"build": "./scripts/build.sh",
|
||||
"build:dev": "TECHDOCS_CLI_DEV_MODE=true yarn build",
|
||||
"clean": "backstage-cli clean",
|
||||
"lint": "backstage-cli lint",
|
||||
"test": "backstage-cli test --testPathIgnorePatterns src/e2e.test.ts",
|
||||
|
||||
@@ -27,7 +27,11 @@ TECHDOCS_PREVIEW_DEST=dist/techdocs-preview-bundle
|
||||
|
||||
# Build the embedded-techdocs-app
|
||||
pushd $EMBEDDED_TECHDOCS_APP_PATH >/dev/null
|
||||
yarn build
|
||||
if [[ $TECHDOCS_CLI_DEV_MODE == "true" ]]; then
|
||||
yarn build:dev
|
||||
else
|
||||
yarn build
|
||||
fi
|
||||
popd >/dev/null
|
||||
|
||||
cp -r $TECHDOCS_PREVIEW_SOURCE $TECHDOCS_PREVIEW_DEST
|
||||
|
||||
@@ -98,9 +98,10 @@ export default async function serve(cmd: Command) {
|
||||
'techdocs-preview-bundle',
|
||||
);
|
||||
|
||||
const port = isDevMode ? backstageBackendPort : backstagePort;
|
||||
const httpServer = new HTTPServer(
|
||||
techdocsPreviewBundlePath,
|
||||
isDevMode ? backstageBackendPort : backstagePort,
|
||||
port,
|
||||
cmd.mkdocsPort,
|
||||
cmd.verbose,
|
||||
);
|
||||
@@ -114,11 +115,9 @@ export default async function serve(cmd: Command) {
|
||||
})
|
||||
.then(() => {
|
||||
// The last three things default/component/local/ don't matter. They can be anything.
|
||||
openBrowser(
|
||||
`http://localhost:${backstagePort}/docs/default/component/local/`,
|
||||
);
|
||||
openBrowser(`http://localhost:${port}/docs/default/component/local/`);
|
||||
logger.info(
|
||||
`Serving docs in Backstage at http://localhost:${backstagePort}/docs/default/component/local/\nOpening browser.`,
|
||||
`Serving docs in Backstage at http://localhost:${port}/docs/default/component/local/\nOpening browser.`,
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user