File tree Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Expand file tree Collapse file tree 1 file changed +8
-10
lines changed Original file line number Diff line number Diff line change @@ -27,16 +27,6 @@ const defaults = {
2727module . exports = function wdm ( compiler , opts ) {
2828 const options = Object . assign ( { } , defaults , opts ) ;
2929
30- if ( options . lazy ) {
31- if ( typeof options . filename === 'string' ) {
32- const filename = options . filename
33- . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, '\\$&' ) // eslint-disable-line no-useless-escape
34- . replace ( / \\ \[ [ a - z ] + \\ \] / gi, '.+' ) ;
35-
36- options . filename = new RegExp ( `^[/]{0,1}${ filename } $` ) ;
37- }
38- }
39-
4030 // defining custom MIME type
4131 if ( options . mimeTypes ) {
4232 const typeMap = options . mimeTypes . typeMap || options . mimeTypes ;
@@ -57,6 +47,14 @@ module.exports = function wdm(compiler, opts) {
5747 }
5848 } ) ;
5949 } else {
50+ if ( typeof options . filename === 'string' ) {
51+ const filename = options . filename
52+ . replace ( / [ \- \[ \] \/ \{ \} \( \) \* \+ \? \. \\ \^ \$ \| ] / g, '\\$&' ) // eslint-disable-line no-useless-escape
53+ . replace ( / \\ \[ [ a - z ] + \\ \] / gi, '.+' ) ;
54+
55+ options . filename = new RegExp ( `^[/]{0,1}${ filename } $` ) ;
56+ }
57+
6058 context . state = true ;
6159 }
6260
You can’t perform that action at this time.
0 commit comments