From 3947d27cf21997f5a601e9132dab1c624ecad6dc Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Wed, 11 Mar 2015 10:50:01 +0100 Subject: [PATCH] Use the webpack hash for automated cache busting --- default_index.html | 6 +++--- index.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/default_index.html b/default_index.html index 6dd89de..e79eae8 100644 --- a/default_index.html +++ b/default_index.html @@ -1,15 +1,15 @@ - + {%=o.htmlWebpackPlugin.options.title || 'Webpack App'%} {% for (var css in o.htmlWebpackPlugin.assets.css) { %} - + {% } %} {% for (var chunk in o.htmlWebpackPlugin.assets.chunks) { %} - + {% } %} diff --git a/index.js b/index.js index fe79799..c1ae587 100644 --- a/index.js +++ b/index.js @@ -12,6 +12,7 @@ HtmlWebpackPlugin.prototype.apply = function(compiler) { var webpackStatsJson = compilation.getStats().toJson(); var templateParams = {}; templateParams.webpack = webpackStatsJson; + templateParams.hash = webpackStatsJson.hash; templateParams.htmlWebpackPlugin = {}; templateParams.htmlWebpackPlugin.assets = self.htmlWebpackPluginAssets(compilation, webpackStatsJson); templateParams.htmlWebpackPlugin.options = self.options;