babel-plugin-import
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -124,15 +124,12 @@ 'use strict'; | ||
} | ||
} else { | ||
// React.createElement(Button) -> React.createElement(_Button) | ||
// if (object && object.name === 'React' && property && property.name === 'createElement' && node.arguments) { | ||
node.arguments = node.arguments.map(function (arg) { | ||
var argName = arg.name; | ||
} | ||
if (_this3.specified[argName] && path.scope.hasBinding(argName) && path.scope.getBinding(argName).path.type === 'ImportSpecifier') { | ||
return _this3.importMethod(_this3.specified[argName], file, opts); | ||
} | ||
return arg; | ||
}); | ||
// } | ||
} | ||
node.arguments = node.arguments.map(function (arg) { | ||
var argName = arg.name; | ||
if (_this3.specified[argName] && path.scope.hasBinding(argName) && path.scope.getBinding(argName).path.type === 'ImportSpecifier') { | ||
return _this3.importMethod(_this3.specified[argName], file, opts); | ||
} | ||
return arg; | ||
}); | ||
} | ||
@@ -139,0 +136,0 @@ }, { |
{ | ||
"name": "babel-plugin-import", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Component modular import plugin for babel.", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -10,2 +10,7 @@ # babel-plugin-import | ||
## Why babel-plugin-import | ||
- [English Instruction](https://ant.design/docs/react/getting-started#Import-on-Demand) | ||
- [中文说明](https://ant.design/docs/react/getting-started-cn#%E6%8C%89%E9%9C%80%E5%8A%A0%E8%BD%BD) | ||
## Example | ||
@@ -86,5 +91,5 @@ | ||
- `["import", [{ "libraryName": "antd" }]]`: import js modularly | ||
- `["import", [{ "libraryName": "antd", "style": true }]]`: import js and css modularly (less source files) | ||
- `["import", [{ "libraryName": "antd", "style": "css" }]]`: import js and css modularly (css built files) | ||
- `["import", { "libraryName": "antd" }]`: import js modularly | ||
- `["import", { "libraryName": "antd", "style": true }]`: import js and css modularly (less source files) | ||
- `["import", { "libraryName": "antd", "style": "css" }]`: import js and css modularly (css built files) | ||
@@ -91,0 +96,0 @@ ### Note |
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
97
15053
300