Skip to content

Commit 91b7921

Browse files
committed
allow module.noParse to be a string
1 parent 5965a3a commit 91b7921

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

lib/NormalModule.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,15 @@ NormalModule.prototype.build = function build(options, compilation, resolver, fs
6969
if(options.module && options.module.noParse) {
7070
if(Array.isArray(options.module.noParse)) {
7171
if(options.module.noParse.some(function(regExp) {
72-
return regExp.test(this.request);
72+
return typeof regExp === "string" ?
73+
this.request.indexOf(regExp) === 0 :
74+
regExp.test(this.request);
7375
}, this)) return callback();
74-
} else if(options.module.noParse.test(this.request))
76+
} else if(typeof regExp === "string" ?
77+
this.request.indexOf(options.module.noParse) === 0 :
78+
options.module.noParse.test(this.request)) {
7579
return callback();
80+
}
7681
}
7782
try {
7883
this.parser.parse(this._source.source(), {

0 commit comments

Comments
 (0)