Hello,
I am using the error-overlay-webpack-plugin in my project and I noticed that the devServer.setupMiddlewares is directly reassigned in the plugin's code. This could potentially overwrite any existing middlewares that have been set up.
Here is the code snippet:
|
compiler.hooks.afterResolvers.tap(className, ({ options }) => { |
|
if (devServerEnabled) { |
|
const originalOnBeforeSetupMiddleware = |
|
options.devServer.onBeforeSetupMiddleware |
|
options.devServer.setupMiddlewares = (middlewares, devServer) => { |
|
if (originalOnBeforeSetupMiddleware) { |
|
originalOnBeforeSetupMiddleware(devServer) |
|
} |
|
middlewares.unshift(errorOverlayMiddleware()); |
|
return middlewares; |
|
} |
|
} |
|
}) |
Could you please confirm if this is the intended behavior? If so, it might be helpful to add a note in the documentation to inform users about this.
Thank you for your time and assistance.
Hello,
I am using the
error-overlay-webpack-pluginin my project and I noticed that thedevServer.setupMiddlewaresis directly reassigned in the plugin's code. This could potentially overwrite any existing middlewares that have been set up.Here is the code snippet:
error-overlay-webpack-plugin/src/index.js
Lines 36 to 48 in 64bf2c1
Could you please confirm if this is the intended behavior? If so, it might be helpful to add a note in the documentation to inform users about this.
Thank you for your time and assistance.