babel-plugin-import
Advanced tools
Comparing version 1.6.5 to 1.6.6
@@ -60,25 +60,21 @@ "use strict"; | ||
value: function importMethod(methodName, file) { | ||
// disable selectedMethods cache, it don't work in babel7 | ||
if (true | ||
/*!this.selectedMethods[methodName]*/ | ||
) { | ||
// eslint-disable-line | ||
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, _helperModuleImports.addDefault)(file.path, path, { | ||
nameHint: methodName | ||
}); | ||
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, _helperModuleImports.addDefault)(file.path, path, { | ||
nameHint: methodName | ||
}); | ||
if (style === true) { | ||
(0, _helperModuleImports.addSideEffect)(file.path, "".concat(path, "/style")); | ||
} else if (style === 'css') { | ||
(0, _helperModuleImports.addSideEffect)(file.path, "".concat(path, "/style/css")); | ||
} | ||
if (style === true) { | ||
(0, _helperModuleImports.addSideEffect)(file.path, "".concat(path, "/style")); | ||
} else if (style === 'css') { | ||
(0, _helperModuleImports.addSideEffect)(file.path, "".concat(path, "/style/css")); | ||
} | ||
} | ||
return this.selectedMethods[methodName]; | ||
return Object.assign({}, this.selectedMethods[methodName]); | ||
} | ||
@@ -85,0 +81,0 @@ }, { |
{ | ||
"name": "babel-plugin-import", | ||
"version": "1.6.5", | ||
"version": "1.6.6", | ||
"description": "Component modular import plugin for babel.", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -60,2 +60,6 @@ # babel-plugin-import | ||
Note : with `style: true` css source files are imported and optimizations can be done during compilation time. With `style: "css"`, pre bundled css files are imported as they are. | ||
`style: true` can reduce the bundle size significantly, depending on your usage of the library. | ||
## Usage | ||
@@ -62,0 +66,0 @@ |
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
17498
123
315