Skip to content

Commit d035781

Browse files
committed
Merge pull request requirejs#49 from jwhitley/regexp_from_string
Allow fileExclusionRegExp to accept a string as well as a JS regexp.
2 parents 76c73bb + 4055f85 commit d035781

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build/jslib/build.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -653,7 +653,11 @@ function (lang, logger, file, parse, optimize, pragma,
653653

654654
//Set file.fileExclusionRegExp if desired
655655
if ('fileExclusionRegExp' in config) {
656-
file.exclusionRegExp = config.fileExclusionRegExp;
656+
if (typeof config.fileExclusionRegExp === "string") {
657+
file.exclusionRegExp = new RegExp(config.fileExclusionRegExp);
658+
} else {
659+
file.exclusionRegExp = config.fileExclusionRegExp;
660+
}
657661
} else if ('dirExclusionRegExp' in config) {
658662
//Set file.dirExclusionRegExp if desired, this is the old
659663
//name for fileExclusionRegExp before 1.0.2. Support for backwards

0 commit comments

Comments
 (0)