requirejs配置文件中有个urlArgs参数,webpack有类似的功能吗?

requirejs配置文件中有个urlArgs参数,用于增加请求js文件时的版本号,可以防止客户端对废弃旧文件的缓存问题。

那webpack有类似的功能吗?如何更新客户端对旧文件的缓存呢?

阅读 5.2k
1 个回答

output.filename

The filename of the entry chunk as relative path inside the output.path directory.

[name] is replaced by the name of the chunk.
[hash] is replaced by the hash of the compilation.
[chunkhash] is replaced by the hash of the chunk.

这里 hashchunkhash 都可以用

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题