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:
Ma Cheng 2016-02-23 19:09:18 +08:00
parent 73a5ef7bef
commit 0b4d7383ea
1 changed files with 1 additions and 0 deletions

View File

@ -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