@babel/plugin-transform-modules-commonjs
Advanced tools
Comparing version 7.20.7 to 7.20.11
@@ -14,13 +14,5 @@ "use strict"; | ||
const buildRequire = noInterop ? requireNoInterop : requireInterop; | ||
const source = (0, _helperModuleTransforms.getDynamicImportSource)(path.node); | ||
const replacement = _core.types.isStringLiteral(source) || _core.types.isTemplateLiteral(source) && source.quasis.length === 0 ? _core.template.expression.ast` | ||
Promise.resolve().then(() => ${buildRequire(source, file)}) | ||
` : _core.template.expression.ast` | ||
Promise.resolve(${source}).then( | ||
s => ${buildRequire(_core.types.identifier("s"), file)} | ||
) | ||
`; | ||
path.replaceWith(replacement); | ||
path.replaceWith((0, _helperModuleTransforms.buildDynamicImport)(path.node, true, false, specifier => buildRequire(specifier, file))); | ||
} | ||
//# sourceMappingURL=dynamic-import.js.map |
{ | ||
"name": "@babel/plugin-transform-modules-commonjs", | ||
"version": "7.20.7", | ||
"version": "7.20.11", | ||
"description": "This plugin transforms ES2015 modules to CommonJS", | ||
@@ -16,3 +16,3 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-module-transforms": "^7.20.7", | ||
"@babel/helper-module-transforms": "^7.20.11", | ||
"@babel/helper-plugin-utils": "^7.20.2", | ||
@@ -19,0 +19,0 @@ "@babel/helper-simple-access": "^7.20.2" |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30914
201