Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-import

Package Overview
Dependencies
Maintainers
4
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-import - npm Package Compare versions

Comparing version 1.12.1 to 1.12.2

8

lib/Plugin.js

@@ -175,4 +175,8 @@ "use strict";

path.replaceWith(this.importMethod(node.property.name, file, pluginState));
} else if (pluginState.specified[node.object.name]) {
node.object = this.importMethod(pluginState.specified[node.object.name], file, pluginState);
} else if (pluginState.specified[node.object.name] && path.scope.hasBinding(node.object.name)) {
const scope = path.scope.getBinding(node.object.name).scope; // global variable in file scope
if (scope.path.parent.type === 'File') {
node.object = this.importMethod(pluginState.specified[node.object.name], file, pluginState);
}
}

@@ -179,0 +183,0 @@ }

{
"name": "babel-plugin-import",
"version": "1.12.1",
"version": "1.12.2",
"description": "Component modular import plugin for babel.",

@@ -33,8 +33,8 @@ "repository": {

"babel-preset-umi": "^1.0.0",
"coveralls": "^2.11.6",
"coveralls": "^3.0.6",
"eslint": "^2.7.0",
"eslint-config-airbnb": "^6.2.0",
"material-ui": "^0.15.4",
"material-ui": "^0.20.2",
"np": "^5.0.3",
"pre-commit": "~1.1.2",
"pre-commit": "~1.2.2",
"react-toolbox": "^1.2.5",

@@ -41,0 +41,0 @@ "umi-tools": "^0.1.4"

@@ -187,4 +187,12 @@ import { join } from 'path';

path.replaceWith(this.importMethod(node.property.name, file, pluginState));
} else if (pluginState.specified[node.object.name]) {
node.object = this.importMethod(pluginState.specified[node.object.name], file, pluginState);
} else if (pluginState.specified[node.object.name] && path.scope.hasBinding(node.object.name)) {
const scope = path.scope.getBinding(node.object.name).scope;
// global variable in file scope
if (scope.path.parent.type === 'File') {
node.object = this.importMethod(
pluginState.specified[node.object.name],
file,
pluginState
);
}
}

@@ -191,0 +199,0 @@ }

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