https://www.cnblogs.com/jayxiangnan/p/9116663.html
https://www.jianshu.com/p/dbc8e0e80de5
react 中打开less 使用方法。 第二个更详细
先安装 antd和babel-plugin-import
npm i/install antd --save
npm i/install babel-plugin-import --save-dev
因为antd默认引入样式是less,所以需要手动配置为CSS,配置方法如下:
运行 npm run eject暴露webpack.config.dev和webpack.config.prod文件
在package.json中配置以下代码
"babel": { "presets": [ "react-app" ], "plugins": [ ["import", { "libraryName": "antd", "libraryDirectory": "es", "style": "css" }] ] }