此文章将于3天后永久迁移至个人博客网站,为不影响使用,请打开如下网址访问。
https://www.iiter.cn/blogs/1
react项目中ant-design按需加载,使用react-app-rewired的时候报错
运行npm start或者yarn start报如下错误:
TypeError: injectBabelPlugin is not a function
原因好像说是react-scripts 升级到 2.1.2 以后破坏了 react-app-rewired
解决方法,对react-scripts进行降级处理
npm install react-app-rewired@2.0.2-next.0
成功解决。