html-webpack-plugin
Advanced tools
Comparing version 2.8.0 to 2.8.1
29
index.js
@@ -48,4 +48,4 @@ 'use strict'; | ||
// If the compilation change didnt change the cache is valid | ||
isCompilationCached = compilationResult.hash && self.hash === compilationResult.hash; | ||
self.hash = compilation.hash; | ||
isCompilationCached = compilationResult.hash && self.childCompilerHash === compilationResult.hash; | ||
self.childCompilerHash = compilationResult.hash; | ||
callback(); | ||
@@ -56,8 +56,2 @@ return compilationResult.content; | ||
compiler.plugin('after-compile', function (compilation, callback) { | ||
// Clear the compilation queue | ||
delete compiler.HtmlWebpackPluginQueue; | ||
callback(); | ||
}); | ||
compiler.plugin('emit', function (compilation, callback) { | ||
@@ -73,3 +67,3 @@ var applyPluginsAsyncWaterfall = Promise.promisify(compilation.applyPluginsAsyncWaterfall, {context: compilation}); | ||
// If the template and the assets did not change we don't have to emit the html | ||
var assetJson = JSON.stringify(assets); | ||
var assetJson = JSON.stringify(self.getAssetFiles(assets)); | ||
if (isCompilationCached && self.options.cache && assetJson === self.assetJson) { | ||
@@ -490,2 +484,5 @@ return callback(); | ||
/** | ||
* Helper to return the absolute template path with a fallback loader | ||
*/ | ||
HtmlWebpackPlugin.prototype.getFullTemplatePath = function (template, context) { | ||
@@ -504,2 +501,16 @@ // If the template doesn't use a loader use the lodash template loader | ||
/** | ||
* Helper to return a sorted unique array of all asset files out of the | ||
* asset object | ||
*/ | ||
HtmlWebpackPlugin.prototype.getAssetFiles = function (assets) { | ||
var files = _.uniq(Object.keys(assets).filter(function (assetType) { | ||
return assetType !== 'chunks' && assets[assetType]; | ||
}).reduce(function (files, assetType) { | ||
return files.concat(assets[assetType]); | ||
}, [])); | ||
files.sort(); | ||
return files; | ||
}; | ||
module.exports = HtmlWebpackPlugin; |
{ | ||
"name": "html-webpack-plugin", | ||
"version": "2.8.0", | ||
"version": "2.8.1", | ||
"description": "Simplifies creation of HTML files to serve your webpack bundles", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
37811
687