Skip to content

Commit

Permalink
fix: preserve both arguments of original before function (#23)
Browse files Browse the repository at this point in the history
The `options.devServer.before` feature accepts two arguments. Unfortunately we're currently throwing one away. This fixes that.

https://webpack.js.org/configuration/dev-server/#devserver-before
  • Loading branch information
cinderblock authored and gregberge committed Nov 18, 2018
1 parent b87f3fc commit 433ccb3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/index.js
Expand Up @@ -14,9 +14,9 @@ class ErrorOverlayPlugin {
compiler.hooks.afterResolvers.tap(className, ({ options }) => {
if (options.devServer) {
const originalBefore = options.devServer.before
options.devServer.before = app => {
options.devServer.before = (app, server) => {
if (originalBefore) {
originalBefore(app)
originalBefore(app, server)
}
app.use(errorOverlayMiddleware())
}
Expand Down

0 comments on commit 433ccb3

Please sign in to comment.