打包后为啥还会出现Multiple assets emit different content to the same filename static/js/.gz
时间: 2023-08-19 08:16:37 浏览: 95
问题: 打包后为什么还会出现"Multiple assets emit different content to the same filename static/js/.gz"的错误?
回答: 这个错误是由于在配置gzip压缩时,多个资源生成了相同的文件名"static/js/.gz"导致的。\[1\]\[2\]解决这个问题的方法是修改配置文件vue.config.js中的filename属性。根据\[3\]的配置示例,将filename的值修改为"\[path\]\[base\].gz"即可解决这个问题。这样每个资源的压缩文件名将会根据其路径和文件名生成,避免了重名的情况。
#### 引用[.reference_title]
- *1* *3* [Conflict: Multiple assets emit different content to the same filename static/js/.gz](https://blog.csdn.net/mmiaoChong/article/details/121138975)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [vue.config配置gzip出现Multiple assets emit different content to the same filename static/js/.gz](https://blog.csdn.net/pinhmin/article/details/129026491)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文