@hirarijs/loader-cjs-interop 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -1
- package/dist/index.js +2 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -41,7 +41,8 @@ var extensions = [".js", ".cjs"];
|
|
|
41
41
|
var isValidIdent = (name) => /^[A-Za-z_$][0-9A-Za-z_$]*$/.test(name);
|
|
42
42
|
function runTransform(code, filename, ctx) {
|
|
43
43
|
const opts = ctx.loaderConfig.pluginOptions?.["@hirarijs/loader-cjs-interop"] || {};
|
|
44
|
-
|
|
44
|
+
const ignoreNm = opts.ignoreNodeModules !== false && opts.allowNodeModules !== true;
|
|
45
|
+
if (ignoreNm && filename.includes("node_modules")) {
|
|
45
46
|
return { code, continue: true };
|
|
46
47
|
}
|
|
47
48
|
if (opts.aliases) {
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,8 @@ var extensions = [".js", ".cjs"];
|
|
|
8
8
|
var isValidIdent = (name) => /^[A-Za-z_$][0-9A-Za-z_$]*$/.test(name);
|
|
9
9
|
function runTransform(code, filename, ctx) {
|
|
10
10
|
const opts = ctx.loaderConfig.pluginOptions?.["@hirarijs/loader-cjs-interop"] || {};
|
|
11
|
-
|
|
11
|
+
const ignoreNm = opts.ignoreNodeModules !== false && opts.allowNodeModules !== true;
|
|
12
|
+
if (ignoreNm && filename.includes("node_modules")) {
|
|
12
13
|
return { code, continue: true };
|
|
13
14
|
}
|
|
14
15
|
if (opts.aliases) {
|