Skip to content

Commit

Permalink
docs: add warning about hmr fails when filename has hash
Browse files Browse the repository at this point in the history
  • Loading branch information
LingyuCoder committed Jan 2, 2025
1 parent 04acf26 commit 7e20d85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion website/docs/zh/config/output.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,7 @@ type ModulePathData = {
:::warning
在进行本地开发时,建议避免在文件名中使用 hash 值。

这是因为入口文件以及被 [`optimization.splitChunks`](/plugins/webpack/split-chunks-plugin) 拆分出的 chunks 都会通过 HTML 文件中的 `<script>` 标签进行加载。此时若文件名内包含 hash 值,则会由于 HTML 无法被动态加载而使得热更新失效。
这是因为入口文件以及被 [`optimization.splitChunks`](/plugins/webpack/split-chunks-plugin) 拆分出的 chunks 都会通过 HTML 文件中的 `<script>` 标签进行加载。此时若文件名内包含 hash 值,则会由于 HTML 无法被动态加载而使得热更新失效。
:::

## output.globalObject
Expand Down

0 comments on commit 7e20d85

Please sign in to comment.