babel-plugin-import-separation
v1.0.0
Published
a plugin for babel to load on demand from import.
Downloads
11
Readme
babel-plugin-import-separation
a plugin for babel to load on demand from import.
Where to add babel-plugin-import
Example
{ "libraryName": "antd" }
import { Button } from 'antd';
ReactDOM.render(<Button>xxxx</Button>);
↓ ↓ ↓ ↓ ↓ ↓
import Button from 'antd/lib/button';
ReactDOM.render(<Button>xxxx</Button>);
{ "libraryName": "antd", style: true }
import { Button } from 'antd';
ReactDOM.render(<Button>xxxx</Button>);
↓ ↓ ↓ ↓ ↓ ↓
import 'antd/lib/button/style';
import Button from 'antd/lib/button';
ReactDOM.render(<_button>xxxx</_button>);
Usage
npm install babel-plugin-import-separation --save-dev
Via .babelrc
or babel-loader.
{
"plugins": [["import", options]]
}