@@ -11,7 +11,7 @@ module.exports = function(compiler, options) {
11
11
if ( ! options ) options = { } ;
12
12
if ( options . watchDelay === undefined ) options . watchDelay = 200 ;
13
13
if ( ! options . stats ) options . stats = { } ;
14
- if ( ! options . stats . context = == undefined ) options . stats . context = process . cwd ( ) ;
14
+ if ( options . stats . context ! == undefined ) options . stats . context = process . cwd ( ) ;
15
15
16
16
// store our files in memory
17
17
var files = { } ;
@@ -111,7 +111,7 @@ module.exports = function(compiler, options) {
111
111
localPrefix = "/" + localPrefix . replace ( / ^ h t t p s ? : \/ \/ [ ^ \/ ] + \/ / , "" ) ;
112
112
}
113
113
// fast exit if another directory requested
114
- if ( url . indexOf ( localPrefix ) != 0 ) return next ( ) ;
114
+ if ( url . indexOf ( localPrefix ) !== 0 ) return false ;
115
115
// get filename from request
116
116
var filename = url . substr ( localPrefix . length ) ;
117
117
return pathJoin ( compiler . outputPath , filename ) ;
@@ -120,6 +120,8 @@ module.exports = function(compiler, options) {
120
120
// The middleware function
121
121
function webpackDevMiddleware ( req , res , next ) {
122
122
var filename = getFilenameFromUrl ( req . url ) ;
123
+ if ( filename === false ) return next ( ) ;
124
+
123
125
// in lazy mode, rebuild on bundle request
124
126
if ( options . lazy && filename === pathJoin ( compiler . outputPath , options . filename ) )
125
127
rebuild ( ) ;
@@ -154,4 +156,4 @@ module.exports = function(compiler, options) {
154
156
webpackDevMiddleware . fileSystem = fs ;
155
157
156
158
return webpackDevMiddleware ;
157
- }
159
+ }
0 commit comments