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.6.5 to 1.6.6

36

lib/Plugin.js

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

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