webpack-md5-hash icon indicating copy to clipboard operation
webpack-md5-hash copied to clipboard

md5-hash有问题,

Open renmm opened this issue 8 years ago • 10 comments

问题:某一个文件的内容改变了,但是文件hash没有改变的情况?

这样导致我上线到服务器上,相同的文件因为有服务器缓存机制,不会被立马刷新,导致访问失败

renmm avatar Jul 22 '16 09:07 renmm

Same here:

File content changes without changing the hash. And also hash is not the same as hash of the content.

dlin-me avatar Sep 01 '16 04:09 dlin-me

Same here. This plugin is not reliable.

le0nik avatar Sep 08 '16 20:09 le0nik

same question

xiwc avatar Oct 17 '16 11:10 xiwc

有坑,别踩。用了webpack.optimize.CommonsChunkPlugin的话,模块内容未变,模块id变了,必炸。可能要背一个线上故障! there has a hole, do not enter in!

Xaber20110202 avatar Oct 27 '16 13:10 Xaber20110202

Looks like duplicated of #7, check out it's thread for the solution.

TL;DR The main issue that module ids not being used for hashing, so when only module ids changed, hash doesn't reflect it. Also it's doing maanual sorting over chunk.modules array, making ids to behave unpredictably when used in concert with OccurrenceOrder plugin.

alexindigo avatar Nov 09 '16 16:11 alexindigo

image image 似乎跟moduleId相关

Thinking80s avatar Mar 06 '17 05:03 Thinking80s

这里有比较详细的解决方案: https://sebastianblade.com/using-webpack-to-achieve-long-term-cache/#webpackmd5hash

whq731 avatar Mar 09 '17 05:03 whq731

Same problem, the hash of manifest.js always remain as d41d8cd, even the content changed. I've searched many times on the internet, still don't get a solution.

oodzchen avatar Jul 20 '17 08:07 oodzchen

Same problem: Hash don't change when source code change.

  1. This plugin is no need any more in webpack4, use contenthash resolve my problem. issues/19

  2. webpack4, in which I test this plugin, change it's chunk module properties, the method this plugin get chunk source code to generate MD5 is not correct any more.

  3. chunk.mapModules used inside this plugin is deprecated.

>  DeprecationWarning: Chunk.mapModules: Use Array.from(chunk.modulesIterable, fn) instead

CntChen avatar Sep 21 '19 12:09 CntChen

https://www.npmjs.com/package/webpack-content-md5-hash plz try my npm package which can solve this problem.

hhhuangqiong avatar Jul 21 '21 03:07 hhhuangqiong