Skip to content

Commit

Permalink
fix(project-utils): update deprecated webpackDevServer method [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel910 committed Feb 19, 2024
1 parent 8348a2f commit 96f7d00
Showing 1 changed file with 11 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ module.exports = function ({ host, port, https, allowedHost, proxy, paths }) {
},
// Enable HTTPS if the HTTPS environment variable is set to 'true'
https,
host,
client: {
overlay: true,
// Silence WebpackDevServer's own logs since they're generally not useful.
Expand All @@ -59,12 +58,17 @@ module.exports = function ({ host, port, https, allowedHost, proxy, paths }) {
},
allowedHosts: allowedHost ? [allowedHost] : undefined,
proxy,
onBeforeSetupMiddleware(devServer) {
const { app } = devServer;
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
require(paths.proxySetup)(app);
}
setupMiddlewares: (middlewares, devServer) => {
return [
...middlewares,
() => {
const { app } = devServer;
if (fs.existsSync(paths.proxySetup)) {
// This registers user provided middleware for proxy reasons
require(paths.proxySetup)(app);
}
}
];
}
};
};

0 comments on commit 96f7d00

Please sign in to comment.