File tree 1 file changed +4
-3
lines changed
1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ class ErrorOverlayPlugin {
22
22
compiler . options . devServer . host
23
23
sockOptions . sockPath =
24
24
compiler . options . devServer . client ?. webSocketURL ?. pathname ||
25
- compiler . options . devServer . webSocketServer ? .options . path ||
25
+ ( compiler . options . devServer . webSocketServer === "object" && compiler . options . devServer . webSocketServer . options ?. path ) ||
26
26
'/ws'
27
27
sockOptions . sockPort =
28
28
compiler . options . devServer . client ?. webSocketURL ?. port ||
@@ -37,11 +37,12 @@ class ErrorOverlayPlugin {
37
37
if ( devServerEnabled ) {
38
38
const originalOnBeforeSetupMiddleware =
39
39
options . devServer . onBeforeSetupMiddleware
40
- options . devServer . onBeforeSetupMiddleware = ( devServer ) => {
40
+ options . devServer . setupMiddlewares = ( middlewares , devServer ) => {
41
41
if ( originalOnBeforeSetupMiddleware ) {
42
42
originalOnBeforeSetupMiddleware ( devServer )
43
43
}
44
- devServer . app . use ( errorOverlayMiddleware ( ) )
44
+ middlewares . unshift ( errorOverlayMiddleware ( ) ) ;
45
+ return middlewares ;
45
46
}
46
47
}
47
48
} )
You can’t perform that action at this time.
0 commit comments