sokra [2:59 PM]
A chunk contains modules i. e. a.js, b.css, and c.wasm. This results in 3 assets being generated JS, CSS and WASM. `[chunkhash]` is the hash of the complete chunk, which is JS + CSS + WASM. `[contenthash]` is the hash of the content of the file, which is different for each asset.
evilebottnawi [3:10 PM]
I.e. better use `[contenthash]` for chunks?
sokra [5:26 PM]
@evilebottnawi better use `contenthash`.
sokra [5:30 PM]
we probably should rename that in webpack 5 to `[hash]`.
evilebottnawi [5:34 PM]
Only one question why we need `chunkhash` after implement `contenthash` :smile: ?
sokra [5:39 PM]
not sure if there is a use case where chunkhash is better, but at least for backward-compat
For long term caching better use
[contenthash]over[chunkhash].From slack
Ref on issue in
webpackwebpack/webpack#7138.Example of problem webpack/mini-css-extract-plugin#117.