antd-mobile 无法加载react-app-rewired
const { injectBabelPlugin } = require('react-app-rewired');
module.exports = function override(config, env) {
config = injectBabelPlugin(['import', { libraryName: 'antd-mobile', style: 'css' }], config);
return config;
};
我按照官网的步骤来的,但是控制台报错
yarn run v1.7.0
$ react-app-rewired start
injectBabelPlugin is not a function
errorinfo Visit Command failed with exit code 1.
https://yarnpkg.com/en/docs/c... for documentation about this command.
Process finished with exit code 1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
已经解决,解决方案
make sure u installed 'customize-cra' and react-app-rewired@2.x
make sure u installed 'less' and 'less-loader'
and then here is the config-overrides.js
const {
override,
fixBabelImports,
addLessLoader,
} = require("customize-cra");
module.exports = override(
fixBabelImports("import", {
}),
addLessLoader({
})
);