暴露所有内建的配置(注:我这里用的是yarn)
yarn eject
注:如果yarn eject 报错的解决的方法
git add .
git commit -m 'aa'
yarn eject
使用babel-plugin-import实现Antd按需加载,并修改package.json
yarn add babel-plugin-import --save-dev
package.json :
"babel": {
"presets": [
"react-app"
],
"plugins": [
[
"import",
{
"libraryName": "antd",
"style": "css"
}
]
]
}