@babel/plugin-transform-modules-systemjs
Advanced tools
Comparing version 7.12.1 to 7.12.13
@@ -43,2 +43,7 @@ "use strict"; | ||
`; | ||
const MISSING_PLUGIN_ERROR = `\ | ||
ERROR: Dynamic import() transformation must be enabled using the | ||
@babel/plugin-proposal-dynamic-import plugin. Babel 8 | ||
no longer transforms import() without using that plugin. | ||
`; | ||
@@ -64,14 +69,16 @@ function getExportSpecifierName(node, stringSpecifiers) { | ||
if (exportNames.length === 1) { | ||
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.stringLiteral(exportNames[0]), exportValues[0]]))); | ||
} else if (!exportStarTarget) { | ||
const objectProperties = []; | ||
if (!exportStarTarget) { | ||
if (exportNames.length === 1) { | ||
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.stringLiteral(exportNames[0]), exportValues[0]]))); | ||
} else { | ||
const objectProperties = []; | ||
for (let i = 0; i < exportNames.length; i++) { | ||
const exportName = exportNames[i]; | ||
const exportValue = exportValues[i]; | ||
objectProperties.push(_core.types.objectProperty(stringSpecifiers.has(exportName) ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), exportValue)); | ||
for (let i = 0; i < exportNames.length; i++) { | ||
const exportName = exportNames[i]; | ||
const exportValue = exportValues[i]; | ||
objectProperties.push(_core.types.objectProperty(stringSpecifiers.has(exportName) ? _core.types.stringLiteral(exportName) : _core.types.identifier(exportName), exportValue)); | ||
} | ||
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.objectExpression(objectProperties)]))); | ||
} | ||
statements.push(_core.types.expressionStatement(_core.types.callExpression(exportIdent, [_core.types.objectExpression(objectProperties)]))); | ||
} else { | ||
@@ -168,3 +175,5 @@ const exportObj = path.scope.generateUid("exportObj"); | ||
if (!this.file.has("@babel/plugin-proposal-dynamic-import")) { | ||
console.warn(MISSING_PLUGIN_WARNING); | ||
{ | ||
console.warn(MISSING_PLUGIN_WARNING); | ||
} | ||
} | ||
@@ -171,0 +180,0 @@ |
{ | ||
"name": "@babel/plugin-transform-modules-systemjs", | ||
"version": "7.12.1", | ||
"version": "7.12.13", | ||
"description": "This plugin transforms ES2015 modules to SystemJS", | ||
@@ -16,6 +16,6 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-hoist-variables": "^7.10.4", | ||
"@babel/helper-module-transforms": "^7.12.1", | ||
"@babel/helper-plugin-utils": "^7.10.4", | ||
"@babel/helper-validator-identifier": "^7.10.4", | ||
"@babel/helper-hoist-variables": "^7.12.13", | ||
"@babel/helper-module-transforms": "^7.12.13", | ||
"@babel/helper-plugin-utils": "^7.12.13", | ||
"@babel/helper-validator-identifier": "^7.12.11", | ||
"babel-plugin-dynamic-import-node": "^2.3.3" | ||
@@ -30,6 +30,7 @@ }, | ||
"devDependencies": { | ||
"@babel/core": "^7.12.1", | ||
"@babel/helper-plugin-test-runner": "7.10.4", | ||
"@babel/core": "7.12.13", | ||
"@babel/helper-plugin-test-runner": "7.12.13", | ||
"@babel/plugin-syntax-dynamic-import": "^7.8.0" | ||
} | ||
}, | ||
"homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-modules-systemjs" | ||
} |
@@ -5,3 +5,3 @@ # @babel/plugin-transform-modules-systemjs | ||
See our website [@babel/plugin-transform-modules-systemjs](https://babeljs.io/docs/en/next/babel-plugin-transform-modules-systemjs.html) for more information. | ||
See our website [@babel/plugin-transform-modules-systemjs](https://babeljs.io/docs/en/babel-plugin-transform-modules-systemjs) for more information. | ||
@@ -8,0 +8,0 @@ ## Install |
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
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
20779
391
0