babel-plugin-import配置babel按需引入antd模块
安装yarn add babel-plugin-import
运行 npm run eject
打开package.json文件
"babel": {
"presets": [
"react-app"
]
添加配置
"babel": {
"presets": [
"react-app"
],
"plugins":
[
[
"import",
{
"libraryName": "antd",
"libraryDirectory": "es",
"style": "css"
}
]
]
}
相关推荐
82530995 2020-10-15
ruanhongbiao 2020-08-16
FEvivi 2020-06-16
FEvivi 2020-06-13
PANH 2020-06-12
zhongweinan 2020-06-10
PANH 2020-06-07
PANH 2020-06-01
webfullStack 2020-04-26
zhongweinan 2020-04-24
FEvivi 2020-04-17
FEvivi 2020-04-15
zhongweinan 2020-03-03
zhongweinan 2020-02-21
PANH 2020-02-19
PANH 2020-01-23
zhongweinan 2020-01-21
上海彭彭 2020-01-14
yinuoqingqin 2020-01-13