babel-plugin-import
Advanced tools
Comparing version 1.6.1 to 1.6.2
@@ -10,2 +10,4 @@ "use strict"; | ||
var _babelHelperModuleImports = require("babel-helper-module-imports"); | ||
function _instanceof(left, right) { if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) { return right[Symbol.hasInstance](left); } else { return left instanceof right; } } | ||
@@ -62,19 +64,19 @@ | ||
// 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 (!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] = (0, _babelHelperModuleImports.addDefault)(file.path, path, { | ||
nameHint: methodName | ||
}); | ||
if (style === true) { | ||
file.addImport("".concat(path, "/style"), 'style'); | ||
} else if (style === 'css') { | ||
file.addImport("".concat(path, "/style/css"), 'style'); | ||
} | ||
if (style === true) { | ||
(0, _babelHelperModuleImports.addSideEffect)(file.path, "".concat(path, "/style")); | ||
} else if (style === 'css') { | ||
(0, _babelHelperModuleImports.addSideEffect)(file.path, "".concat(path, "/style/css")); | ||
} | ||
} | ||
@@ -81,0 +83,0 @@ return this.selectedMethods[methodName]; |
{ | ||
"name": "babel-plugin-import", | ||
"version": "1.6.1", | ||
"version": "1.6.2", | ||
"description": "Component modular import plugin for babel.", | ||
@@ -31,2 +31,3 @@ "repository": { | ||
"babel-plugin-add-module-exports": "^0.1.2", | ||
"babel-polyfill": "^7.0.0-beta.3", | ||
"babel-preset-es2015": "^7.0.0-beta.2", | ||
@@ -58,3 +59,6 @@ "babel-preset-react": "^7.0.0-beta.2", | ||
"README.md" | ||
] | ||
], | ||
"dependencies": { | ||
"babel-helper-module-imports": "^7.0.0-beta.3" | ||
} | ||
} |
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
17187
306
1
17
+ Addedbabel-helper-module-imports@7.0.0-beta.3(transitive)
+ Addedbabel-types@7.0.0-beta.3(transitive)
+ Addedesutils@2.0.3(transitive)
+ Addedlodash@4.17.21(transitive)
+ Addedto-fast-properties@2.0.0(transitive)