html-webpack-plugin should output an index.html file which can then be compressed by the compression-plugin
Current behaviour
In Webpack 5 (tested in rc3), the index.html file seems to be output after the compression plugin runs. Hence, it is never compressed and the app breaks. This seems to be a general change in how wp5 handles the plugin lifecycle, but I can't figure it out.
Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:
Node.js v14.13.0
darwin 19.6.0
webpack@5.0.0-rc.3
html-webpack-plugin@4.5.0
Config
Copy the minimal webpack.config.js to produce this issue:
This worked without issue under webpack 4. Analysing what gets fed to the compression-plugin, I see the following from html-webpack-plugin under webpack 5:
Expected behaviour
html-webpack-plugin should output an index.html file which can then be compressed by the compression-plugin
Current behaviour
In Webpack 5 (tested in rc3), the index.html file seems to be output after the compression plugin runs. Hence, it is never compressed and the app breaks. This seems to be a general change in how wp5 handles the plugin lifecycle, but I can't figure it out.
Environment
Tell us which operating system you are using, as well as which versions of Node.js, npm, webpack, and html-webpack-plugin. Run the following to get it quickly:
Config
Copy the minimal
webpack.config.js
to produce this issue:Additional context
This worked without issue under webpack 4. Analysing what gets fed to the compression-plugin, I see the following from html-webpack-plugin under webpack 5: