File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 5
5
var MemoryFileSystem = require ( "memory-fs" ) ;
6
6
var mime = require ( "mime" ) ;
7
7
8
+ var HASH_REGEXP = / [ 0 - 9 a - f ] { 10 , } / ;
9
+
8
10
// constructor for the middleware
9
11
module . exports = function ( compiler , options ) {
10
12
if ( ! options ) options = { } ;
@@ -148,8 +150,17 @@ module.exports = function(compiler, options) {
148
150
if ( options . lazy && ( ! options . filename || options . filename . test ( filename ) ) )
149
151
rebuild ( ) ;
150
152
153
+ if ( HASH_REGEXP . test ( filename ) ) {
154
+ try {
155
+ if ( fs . statSync ( filename ) . isFile ( ) ) {
156
+ processRequest ( ) ;
157
+ return ;
158
+ }
159
+ } catch ( e ) { }
160
+ }
151
161
// delay the request until we have a vaild bundle
152
- ready ( function ( ) {
162
+ ready ( processRequest , req ) ;
163
+ function processRequest ( ) {
153
164
try {
154
165
var stat = fs . statSync ( filename ) ;
155
166
if ( ! stat . isFile ( ) ) {
@@ -176,7 +187,7 @@ module.exports = function(compiler, options) {
176
187
}
177
188
}
178
189
res . send ( content ) ;
179
- } , req ) ;
190
+ }
180
191
}
181
192
182
193
webpackDevMiddleware . getFilenameFromUrl = getFilenameFromUrl ;
You can’t perform that action at this time.
0 commit comments