@babel/plugin-transform-modules-systemjs
Advanced tools
Comparing version 7.4.4 to 7.5.0
@@ -38,2 +38,12 @@ "use strict"; | ||
function _utils() { | ||
const data = require("babel-plugin-dynamic-import-node/utils"); | ||
_utils = function () { | ||
return data; | ||
}; | ||
return data; | ||
} | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -58,2 +68,7 @@ | ||
`); | ||
const MISSING_PLUGIN_WARNING = `\ | ||
WARNING: Dynamic import() transformation must be enabled using the | ||
@babel/plugin-proposal-dynamic-import plugin. Babel 8 will | ||
no longer transform import() without using that plugin. | ||
`; | ||
@@ -96,4 +111,2 @@ function constructExportCall(path, exportIdent, exportNames, exportValues, exportStarTarget) { | ||
const TYPE_IMPORT = "Import"; | ||
var _default = (0, _helperPluginUtils().declare)((api, options) => { | ||
@@ -159,6 +172,15 @@ api.assertVersion(7); | ||
name: "transform-modules-systemjs", | ||
pre() { | ||
this.file.set("@babel/plugin-transform-modules-*", "systemjs"); | ||
}, | ||
visitor: { | ||
CallExpression(path, state) { | ||
if (path.node.callee.type === TYPE_IMPORT) { | ||
path.replaceWith(_core().types.callExpression(_core().types.memberExpression(_core().types.identifier(state.contextIdent), _core().types.identifier("import")), path.node.arguments)); | ||
if (_core().types.isImport(path.node.callee)) { | ||
if (!this.file.has("@babel/plugin-proposal-dynamic-import")) { | ||
console.warn(MISSING_PLUGIN_WARNING); | ||
} | ||
path.replaceWith(_core().types.callExpression(_core().types.memberExpression(_core().types.identifier(state.contextIdent), _core().types.identifier("import")), [(0, _utils().getImportSource)(_core().types, path.node)])); | ||
} | ||
@@ -165,0 +187,0 @@ }, |
{ | ||
"name": "@babel/plugin-transform-modules-systemjs", | ||
"version": "7.4.4", | ||
"version": "7.5.0", | ||
"description": "This plugin transforms ES2015 modules to SystemJS", | ||
@@ -13,3 +13,4 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-modules-systemjs", | ||
"@babel/helper-hoist-variables": "^7.4.4", | ||
"@babel/helper-plugin-utils": "^7.0.0" | ||
"@babel/helper-plugin-utils": "^7.0.0", | ||
"babel-plugin-dynamic-import-node": "^2.3.0" | ||
}, | ||
@@ -23,7 +24,7 @@ "keywords": [ | ||
"devDependencies": { | ||
"@babel/core": "^7.4.4", | ||
"@babel/core": "^7.5.0", | ||
"@babel/helper-plugin-test-runner": "^7.0.0", | ||
"@babel/plugin-syntax-dynamic-import": "^7.2.0" | ||
}, | ||
"gitHead": "2c88694388831b1e5b88e4bbed6781eb2be1edba" | ||
"gitHead": "49da9a07c81156e997e60146eb001ea77b7044c4" | ||
} |
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
18847
360
4
+ Addedbabel-plugin-dynamic-import-node@2.3.3(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddefine-properties@1.2.1(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedobject-keys@1.1.1(transitive)
+ Addedobject.assign@4.1.5(transitive)
+ Addedset-function-length@1.2.2(transitive)