Fix passing arguments from backstage-cli backend:dev to package

The old Webpack version would invoke the backend package in the same
process, hence `process.argv` would contain the arguments passed to
`backstage-cli`. This no longer seems to be true in Webpack 5, so
arguments must be explicitly passed.

Signed-off-by: Joel Low <joel@joelsplace.sg>
This commit is contained in:
Joel Low
2021-08-16 13:36:19 +08:00
parent d99698a5f4
commit 485438a569
2 changed files with 6 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
Fix `backstage-cli backend:dev` argument passing
+1
View File
@@ -318,6 +318,7 @@ export async function createBackendConfig(
new RunScriptWebpackPlugin({
name: 'main.js',
nodeArgs: options.inspectEnabled ? ['--inspect'] : undefined,
args: process.argv.slice(3), // drop `node backstage-cli backend:dev`
}),
new webpack.HotModuleReplacementPlugin(),
...(checksEnabled