@nightlylabs/html-webpack-plugin
Advanced tools
Comparing version 5.5.2 to 5.5.3
10
index.js
@@ -232,7 +232,5 @@ // @ts-check | ||
const a = Array.from(compilation.chunks).map(a => a.files[0]); | ||
console.log(a); | ||
const entryNames = Array.from(compilation.entrypoints.keys()); | ||
const filteredEntryNames = filterChunks(entryNames, options.chunks, options.excludeChunks); | ||
const sortedEntryNames = sortEntryChunks(filteredEntryNames, options.chunksSortMode, compilation); | ||
const templateResult = options.templateContent | ||
@@ -255,8 +253,14 @@ ? { mainCompilationHash: compilation.hash } | ||
const assets = htmlWebpackPluginAssets(compilation, sortedEntryNames, htmlPublicPath); | ||
// console.log(assets); | ||
const files = getAssetFiles(assets).concat(a); | ||
const filesSet = new Set(files); | ||
const filesSet = new Set(files) | ||
// If the template and the assets did not change we don't have to emit the html | ||
const newAssetJson = JSON.stringify(Array.from(filesSet)); | ||
// console.log(newAssetJson); | ||
console.log(assets.js); | ||
assets.js = Array.from(filesSet); | ||
console.log(assets.js); | ||
if (isCompilationCached && options.cache && assetJson === newAssetJson) { | ||
previousEmittedAssets.forEach(({ name, html }) => { | ||
console.log(name); | ||
compilation.emitAsset(name, new webpack.sources.RawSource(html, false)); | ||
@@ -263,0 +267,0 @@ }); |
{ | ||
"name": "@nightlylabs/html-webpack-plugin", | ||
"version": "5.5.2", | ||
"version": "5.5.3", | ||
"license": "MIT", | ||
@@ -5,0 +5,0 @@ "description": "Simplifies creation of HTML files to serve your webpack bundles", |
116339
2237