a plugin for babel to load on demand from import.
npm install babel-plugin-import-separationa plugin for babel to load on demand from import.
---
#### { "libraryName": "antd" }
``javascript
import { Button } from 'antd';
ReactDOM.render();
↓ ↓ ↓ ↓ ↓ ↓
import Button from 'antd/lib/button';
ReactDOM.render();
`
#### { "libraryName": "antd", style: true }
`javascript
import { Button } from 'antd';
ReactDOM.render();
↓ ↓ ↓ ↓ ↓ ↓
import 'antd/lib/button/style';
import Button from 'antd/lib/button';
ReactDOM.render(<_button>xxxx);
`
`bash`
npm install babel-plugin-import-separation --save-dev
Via .babelrc or babel-loader.
`js``
{
"plugins": [["import", options]]
}