Skip to content

Commit

Permalink
feat: process html during the processAssets stage PROCESS_ASSETS_STAG…
Browse files Browse the repository at this point in the history
…E_OPTIMIZE_INLINE
  • Loading branch information
jantimon committed Feb 3, 2021
1 parent 0f9c239 commit 2975a6a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions index.js
Expand Up @@ -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());
Expand Down

0 comments on commit 2975a6a

Please sign in to comment.