babel-plugin-import-demand
Example
Converts
;
(roughly) to
var _button = ; var _button2 = ; ; var _date_picker = ; var _date_picker2 = ; ;
Usage
npm install babel-plugin-import-demand --save-dev
Via .babelrc
or babel-loader.
"plugins": "import-demand" options
options
options
can be object.
For Example:
"libName": "antd" "libPath": "lib" // default: lib "spell": true // default: false "cssPath": "style/css" // default: undefined
options
can be an array.
For Example:
"libName": "project" "libPath": "dist" // default: lib "libName": "antd" "libPath": "lib" "spell": true "cssPath": "style"
Note
babel-plugin-import-demand will be not working if you add the library in webpack config vender