Skip to content
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

【webpack4】 develop模式下生成的虚拟目录中的文件名,为什么不携带output配置中的chunkhash? #1

Open
hh2o4 opened this issue Nov 10, 2021 · 0 comments

Comments

@hh2o4
Copy link
Owner

hh2o4 commented Nov 10, 2021

现象

output配置中的类似 filename: '[name].[chunkhash].js', 在develop模式下生成的文件名不携带chunkhash, 如下图1:

image

而production模式下,hash会正常存在,如下图:

image

分析

如果develop模式下,使用了dev-server,而在dev-server的配置中做了如下配置,导致develop模式下生成的文件名没有hash。

image

如果注释掉这句文件名的配置,默认用项目中基础配置 oubput.filename = '[name].[chunkname].js', 会有如下报错:

image

github上相关issue显示,使用热更新时,不应使用hash添加到文件名中,会导致问题,但具体什么问题,没有提及,暂时不再继续深究。(附issue相关链接
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant