1、安装插件
cnpm install babel-plugin-import --save
2、配置
npm run eject //显示package.json文件中的配置信息
“babel”: {
“presets”: [
“react-app”
]
}
在Package.json文件中添加如下配置信息
“babel”: {
“presets”: [
“react-app”
],
“plugins”: [
[“import”, { “libraryName”: “antd-mobile”, “style”: “css” }]
]
}