Skip to content

Commit

Permalink
fix: pass in compiler to devServer before() (#66)
Browse files Browse the repository at this point in the history
The [`devServer.before()`](https://webpack.js.org/configuration/dev-server/#devserverbefore) API accepts three arguments: `app`, `server`, and `compiler`. When overriding this function, though, `error-overlay-webpack-plugin` only passes in the first two arguments, which can lead to exceptions when other `before` functions try to access `compiler`. This fixes that.
  • Loading branch information
nolanlawson committed Oct 28, 2020
1 parent 49abacd commit c0feceb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -26,7 +26,7 @@ class ErrorOverlayPlugin {
const originalBefore = options.devServer.before
options.devServer.before = (app, server) => {
if (originalBefore) {
originalBefore(app, server)
originalBefore(app, server, compiler)
}
app.use(errorOverlayMiddleware())
}
Expand Down

0 comments on commit c0feceb

Please sign in to comment.