-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Webpack 常见问题与解答 #7
Comments
在本地下载webpack作为本地使用时,发现出了一个这个错误: 怎么解决啊? |
@amwamew 未安装 transform-runtime 吗?看报错 Unknown plugin "transform-runtime" |
请问了解webpack对于循环依赖有处理方式吗?我看了一些文档得到的结论是webpack暂时并没有很好的处理循环依赖的方式 |
1.同级目录的文件引用需要带上 './'
[Q] Module not found: Errorr: Cannot resolve module
[A] 将 require('index.less'); 替换为 require('./index.less');
2.window 使用 \ 作为路径分隔符
[Q] Module not found: Error: Cannot resolve 'file' or 'directory' ./../../../../node_modules/css-loader/index.js and Module not found: Error: Cannot resolve 'file' or 'directory' ./../../../../node_modules/style-loader/addStyles.js
[A] webpack.config.js 中,路径的使用 path.join(__dirname, 'src'),而不使用 __dirname + '/src',eg:
两者的不同,可看一下输出
3.less-loader 的使用需要配套 less module
[Q] ERROR in Cannot find module 'less'
[A] install less module
未完,持续更新,欢迎讨论与补充~
The text was updated successfully, but these errors were encountered: