Skip to content

Commit c0feceb

Browse files
authored
fix: pass in compiler to devServer before() (#66)
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.
1 parent 49abacd commit c0feceb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ class ErrorOverlayPlugin {
2626
const originalBefore = options.devServer.before
2727
options.devServer.before = (app, server) => {
2828
if (originalBefore) {
29-
originalBefore(app, server)
29+
originalBefore(app, server, compiler)
3030
}
3131
app.use(errorOverlayMiddleware())
3232
}

0 commit comments

Comments
 (0)