|
|
@ -111,11 +111,13 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' |
|
|
|
```js |
|
|
|
// .babelrc or babel-loader option |
|
|
|
{ |
|
|
|
"plugins": [["import", { libraryName: "antd", style: "css" }]] |
|
|
|
"plugins": [ |
|
|
|
["import", { libraryName: "antd", style: "css" }] // `style: true` for less |
|
|
|
] |
|
|
|
} |
|
|
|
``` |
|
|
|
|
|
|
|
Then you can import components from antd directly. |
|
|
|
Then you can import components from antd, equivalent to import manually below. |
|
|
|
|
|
|
|
```jsx |
|
|
|
// import js and css modularly, parsed by babel-plugin-import |
|
|
@ -125,8 +127,9 @@ import 'antd/dist/antd.css'; // or 'antd/dist/antd.less' |
|
|
|
- Manually import |
|
|
|
|
|
|
|
```jsx |
|
|
|
import DatePicker from 'antd/lib/date-picker'; // just js |
|
|
|
import 'antd/lib/button/style'; // or antd/lib/button/style/css for css format file |
|
|
|
import DatePicker from 'antd/lib/date-picker'; // for js |
|
|
|
import 'antd/lib/date-picker/style/css'; // for css |
|
|
|
// import 'antd/lib/date-picker/style'; // that will import less |
|
|
|
``` |
|
|
|
|
|
|
|
## Useful Links |
|
|
|