-
-
Notifications
You must be signed in to change notification settings - Fork 49.8k
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 合并文件时出现警告错误: Cannot resolve 'file' or 'directory' ./locale #3204
Comments
可以把整个 trace 贴出来? |
就是这个 error 的完整版: WARNING in ./~/antd/dist/antd.js
Module not found: Error: Cannot resolve 'file' or 'directory' ./locale in /Users/samzhang/work/monitor/node_modules/antd/dist
@ ./~/antd/dist/antd.js 14479:17-44 |
然后使用 |
我也遇到同样的问题,请问解决了吗? @benjycui |
@afc163 done |
I am still having this issue using babel-import-module, or using the @afc163 solution, am I missing something obvious? This is only happening on my release config, I can debug it fine. |
感觉已构建文件应该提前处理掉这个问题。 |
总结一下,此问题出现在 d063ed4 里修复了 在新版本发布之前,解决方案有两个:
额外的警告,遇到这个问题也意味着你没有使用 antd 配套的按需加载功能(babel-plugin-import),可能会导致静态文件过大。 如果 2.1.0 之后,你还是遇到了 moment 的问题,解决方案可见:#3508 |
有同样的问题(已经解决), 另外还有个问题 antd 已经分离到 dll 文件中了, 但打包时不能依然打包了 antd ? 有谁知道吗? (webpack 3.x) |
引入
antd
通过webpack
打包合并文件时,控制台出现警告:倒是不影响使用,看了下原因,引入
monent
模块所致,require('./locale/' + name);
The text was updated successfully, but these errors were encountered: