Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-modules-systemjs

Package Overview
Dependencies
Maintainers
5
Versions
99
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-modules-systemjs - npm Package Compare versions

Comparing version 7.4.4 to 7.5.0

30

lib/index.js

@@ -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 @@ },

9

package.json
{
"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"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc