赞
踩
You attempted to import xxx which falls outside of the project src/ directory.Relative imports outside of src/ are not supported.You can either move it inside src/, or add a symlink to it from project's node_modules/.
您尝试导入/Users/wen/gisspring project/smart city management/node_modules/console browserify/index。js位于项目src/目录之外。不支持src/之外的相对导入。您可以将其移动到src/中,也可以从项目的node_modules/向其添加符号链接。
就是引入了src 外的资源(js,css,img等等)
1. 可以 把 引入的资源放到 src里
2. 因为这个 是webpack里配置了 ModuleScopePlugin 。
webpack.config.js中配置了 new ModuleScopePlugin(paths.appSrc, [paths.appPackageJson]),导致限制开发者从非src目录导入模块文件
在webpack.config.js中查找 ModuleScopePlugin 并注释即可。
- new ModuleScopePlugin(paths.appSrc, [
- paths.appPackageJson,
- reactRefreshRuntimeEntry,
- reactRefreshWebpackPluginRuntimeEntry,
- babelRuntimeEntry,
- babelRuntimeEntryHelpers,
- babelRuntimeRegenerator,
- ]),
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。