From 86245db670a9b3bdd0e2aba9f2031745a98434c7 Mon Sep 17 00:00:00 2001 From: Jan Nicklas Date: Sat, 7 Nov 2020 15:46:50 +0100 Subject: [PATCH] feat: process html during the processAssets stage PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE --- index.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/index.js b/index.js index ab9e3198..e5224a18 100644 --- a/index.js +++ b/index.js @@ -214,13 +214,17 @@ function hookIntoCompiler (compiler, options, plugin) { compilation.hooks.processAssets.tapAsync( { name: 'HtmlWebpackPlugin', - stage: webpack.Compilation.PROCESS_ASSETS_STAGE_ADDITIONS + stage: + /** + * Generate the html after minification and dev tooling is done + */ + webpack.Compilation.PROCESS_ASSETS_STAGE_OPTIMIZE_INLINE }, /** - * Hook into the PROCESS_ASSETS_STAGE_ADDITIONS hook - * @param {WebpackCompilation} compilationAssets - * @param {(err?: Error) => void} callback - */ + * Hook into the process assets hook + * @param {WebpackCompilation} compilationAssets + * @param {(err?: Error) => void} callback + */ (compilationAssets, callback) => { // Get all entry point names for this html file const entryNames = Array.from(compilation.entrypoints.keys());