Add chunk hash to `assets.chunks`
Add chunk hash to `assets.chunks` so can use it in template. For some version control requirements, chunk hash may be more useful than compilation hash. For example, if there are two chunks in page, but only one of them is changed, chunk hash is more cache-friendly.
This commit is contained in:
parent
73a5ef7bef
commit
0b4d7383ea
1
index.js
1
index.js
|
|
@ -378,6 +378,7 @@ HtmlWebpackPlugin.prototype.htmlWebpackPluginAssets = function (compilation, chu
|
|||
var entry = chunkFiles[0];
|
||||
assets.chunks[chunkName].size = chunk.size;
|
||||
assets.chunks[chunkName].entry = entry;
|
||||
assets.chunks[chunkName].hash = chunk.hash;
|
||||
assets.js.push(entry);
|
||||
|
||||
// Gather all css files
|
||||
|
|
|
|||
Loading…
Reference in New Issue