antd-mobile react-app-rewiredをロードできません

1178 ワード

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 v 1を間違えました.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
 
ソリューションmake sure u installed'customize-cra'and [email protected] 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", {
libraryName: "antd", libraryDirectory: "es", style: true // change importing css to less

}), addLessLoader({
javascriptEnabled: true,
modifyVars: { "@primary-color": "#1DA57A" }

}) );