From 0b4d7383ea42829b7eaa190e900a5f36a270b84f Mon Sep 17 00:00:00 2001 From: Ma Cheng Date: Tue, 23 Feb 2016 19:09:18 +0800 Subject: [PATCH] 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. --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 9932dd8..1af1f30 100644 --- a/index.js +++ b/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