-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
问题现象:
构建报错 Conflict: Multiple assets emit different content to the same filename static/bg.jpg
问题位置:
kmi/packages/bundler-shared-config/src/config/output.ts
Lines 43 to 48 in 55b9b0c
| .set( | |
| 'assetModuleFilename', | |
| useHash | |
| ? `${staticPathPrefix}[name].[contenthash:8][ext]` | |
| : `${staticPathPrefix}[name][ext]`, | |
| ) |
这里在用户没有配置 hash 为 true 的情况下。assets 上不会有 hash。导致项目内 import 相同名字的两张图片报错。
建议解决方案:
参考 umi 默认 webpack 配置,任何场景下都加 [contenthash:8]
https://github.com/umijs/umi/blob/dc1b0d81f34f294ba873e0a3004f94d335f591d5/packages/bundler-webpack/src/config/config.ts#L132-L135
xierenyuan
Metadata
Metadata
Assignees
Labels
No labels