🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

babel-plugin-import

Package Overview
Dependencies
Maintainers
3
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

to
1.6.1

29

lib/Plugin.js

@@ -60,17 +60,20 @@ "use strict";

value: function importMethod(methodName, file) {
if (!this.selectedMethods[methodName]) {
var libraryDirectory = this.libraryDirectory;
var style = this.style;
var transformedMethodName = this.camel2UnderlineComponentName // eslint-disable-line
? camel2Underline(methodName) : this.camel2DashComponentName ? camel2Dash(methodName) : methodName;
var path = winPath(this.customName ? this.customName(transformedMethodName) : (0, _path.join)(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
);
this.selectedMethods[methodName] = file.addImport(path, 'default');
// disable selectedMethods cache, it don't work in babel7
if (true
/* !this.selectedMethods[methodName] */
) {
var libraryDirectory = this.libraryDirectory;
var style = this.style;
var transformedMethodName = this.camel2UnderlineComponentName // eslint-disable-line
? camel2Underline(methodName) : this.camel2DashComponentName ? camel2Dash(methodName) : methodName;
var path = winPath(this.customName ? this.customName(transformedMethodName) : (0, _path.join)(this.libraryName, libraryDirectory, transformedMethodName, this.fileName) // eslint-disable-line
);
this.selectedMethods[methodName] = file.addImport(path, 'default');
if (style === true) {
file.addImport("".concat(path, "/style"), 'style');
} else if (style === 'css') {
file.addImport("".concat(path, "/style/css"), 'style');
if (style === true) {
file.addImport("".concat(path, "/style"), 'style');
} else if (style === 'css') {
file.addImport("".concat(path, "/style/css"), 'style');
}
}
}

@@ -77,0 +80,0 @@ return this.selectedMethods[methodName];

{
"name": "babel-plugin-import",
"version": "1.6.0",
"version": "1.6.1",
"description": "Component modular import plugin for babel.",

@@ -27,10 +27,10 @@ "repository": {

"devDependencies": {
"babel-cli": "^7.0.0-beta.1",
"babel-core": "^7.0.0-beta.1",
"babel-cli": "^7.0.0-beta.2",
"babel-core": "^7.0.0-beta.2",
"babel-istanbul": "^0.12.2",
"babel-plugin-add-module-exports": "^0.1.2",
"babel-preset-es2015": "^7.0.0-beta.1",
"babel-preset-react": "^7.0.0-beta.1",
"babel-preset-stage-0": "^7.0.0-beta.1",
"babel-register": "^7.0.0-beta.1",
"babel-preset-es2015": "^7.0.0-beta.2",
"babel-preset-react": "^7.0.0-beta.2",
"babel-preset-stage-0": "^7.0.0-beta.2",
"babel-register": "^7.0.0-beta.2",
"coveralls": "^2.11.6",

@@ -37,0 +37,0 @@ "eslint": "^2.7.0",

@@ -15,2 +15,7 @@ # babel-plugin-import

## Where to add babel-plugin-import
- [babelrc](https://babeljs.io/docs/usage/babelrc/)
- [babel-loader](https://github.com/babel/babel-loader)
## Example

@@ -17,0 +22,0 @@