Add inspectBrk to try to use when debugging backend node

Signed-off-by: shenowen <owen.shen@aa.com>
This commit is contained in:
shenowen
2021-10-04 13:56:38 -05:00
parent 01a468aee3
commit 89629a7f08
4 changed files with 5 additions and 1 deletions
+1
View File
@@ -29,6 +29,7 @@ export default async (cmd: Command) => {
entry: 'src/index',
checksEnabled: cmd.check,
inspectEnabled: cmd.inspect,
inspectBrkEnabled: cmd.inspectBrk,
});
await waitForExit();
+1
View File
@@ -69,6 +69,7 @@ export function registerCommands(program: CommanderStatic) {
.description('Start local development server with HMR for the backend')
.option('--check', 'Enable type checking and linting')
.option('--inspect', 'Enable debugger')
.option('--inspect-brk', 'Enable debugger with await to attach debugger')
// We don't actually use the config in the CLI, just pass them on to the NodeJS process
.option(...configOption)
.action(lazy(() => import('./backend/dev').then(m => m.default)));
+1 -1
View File
@@ -319,7 +319,7 @@ export async function createBackendConfig(
plugins: [
new RunScriptWebpackPlugin({
name: 'main.js',
nodeArgs: options.inspectEnabled ? ['--inspect'] : undefined,
nodeArgs: options.inspectEnabled ? ['--inspect'] : options.inspectEnabled ? ['--inspect-brk'] : undefined,
args: process.argv.slice(3), // drop `node backstage-cli backend:dev`
}),
new webpack.HotModuleReplacementPlugin(),
+2
View File
@@ -47,11 +47,13 @@ export type BackendBundlingOptions = {
isDev: boolean;
parallel?: ParallelOption;
inspectEnabled: boolean;
inspectBrkEnabled: boolean;
};
export type BackendServeOptions = BundlingPathsOptions & {
checksEnabled: boolean;
inspectEnabled: boolean;
inspectBrkEnabled: boolean;
};
export type LernaPackage = {