We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b3fe2b0 commit 4d6413fCopy full SHA for 4d6413f
mixed-format/loader.mjs
@@ -25,10 +25,10 @@ function containsCJS(source) {
25
const src = '' + source;
26
27
// A realistic version of this loader would use a parser like Acorn to check for actual `module.exports` syntax
28
- if (src.match(/exports[\.( ?=)]/)) { return true };
+ if ((/exports[\[\.( ?=)]/).test(src)) { return true };
29
30
if (
31
- src.match(/require\(/)
32
- && !src.match(/createRequire\(/)
33
- ) return true;
+ (/require\(/).test(src)
+ && !(/createRequire\(/).test(src)
+ ) { return true; }
34
}
0 commit comments