Cli/server: Fix webpack deprecation warnings
Running the development dev server results in the following deprecation warnings from "webpack-dev-server". * [DEP_WEBPACK_DEV_SERVER_CONSTRUCTOR] DeprecationWarning: Using 'compiler' as the first argument is deprecated. Please use 'options' as the first argument and 'compiler' as the second argument. * [DEP_WEBPACK_DEV_SERVER_LISTEN] DeprecationWarning: 'listen' is deprecated. Please use the async 'start' or 'startCallback' method. Signed-off-by: Niklas Aronsson <niklasar@axis.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/cli': patch
|
||||
---
|
||||
|
||||
Fix `webpack-dev-server` deprecations.
|
||||
@@ -43,7 +43,6 @@ export async function serveBundle(options: ServeOptions) {
|
||||
const compiler = webpack(config);
|
||||
|
||||
const server = new WebpackDevServer(
|
||||
compiler as any,
|
||||
{
|
||||
hot: !process.env.CI,
|
||||
devMiddleware: {
|
||||
@@ -71,10 +70,11 @@ export async function serveBundle(options: ServeOptions) {
|
||||
webSocketURL: 'auto://0.0.0.0:0/ws',
|
||||
},
|
||||
} as any,
|
||||
compiler as any,
|
||||
);
|
||||
|
||||
await new Promise<void>((resolve, reject) => {
|
||||
server.listen(port, host, (err?: Error) => {
|
||||
server.startCallback((err?: Error) => {
|
||||
if (err) {
|
||||
reject(err);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user