美文网首页
react配置antd按需加载以及sass配置

react配置antd按需加载以及sass配置

作者: 本萌妹 | 来源:发表于2019-08-14 14:13 被阅读0次

1.

npm install antd --save 

npm install sass-loader node-sass --save-dev

npm run eject

暴露出配置,webpack配置文件只有webpack.config.js(因为官方脚手架升级了)

2.若是报如下错误:

git add .

git commit -m 'xxx'

npm run eject

3.在/config/webpack.config.js中rules里最后加入以下代码

4.在/config/webpack.config.js中plugins中加入如下代码:

5.重启编辑器

相关文章

网友评论

      本文标题:react配置antd按需加载以及sass配置

      本文链接:https://www.haomeiwen.com/subject/wjxvdctx.html