当前位置:   article > 正文

react使用脚手架,配置 react-app-rewired,src外资源引用报错处理_which falls outside of the project src/ directory.

which falls outside of the project src/ directory. relative imports outside

报错:which falls outside of the project src/ directory. Relative imports outside of src/ are not supported.

解决方案:

原文地址:https://stackoverflow.com/questions/44114436/the-create-react-app-imports-restriction-outside-of-src-directory?noredirect=1

在config-overrides.js中配置:

  1. const ModuleScopePlugin = require('react-dev-utils/ModuleScopePlugin');
  2. module.exports = function override(config, env) {
  3. config.resolve.plugins = config.resolve.plugins.filter(plugin => !(plugin instanceof ModuleScopePlugin));
  4. return config;
  5. };
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/65946
推荐阅读
相关标签
  

闽ICP备14008679号