Closed issacgerges closed 7 months ago
I don't think we should change stage, can you create reproducible example with your custom plugin, I will investigate
This issue is trying to resolve #1638, which is caused by Webpack 5's contenthash
change: https://github.com/webpack/webpack/issues/9520.
let's close in favor https://github.com/jantimon/html-webpack-plugin/issues/1638
Is your feature request related to a problem? Please describe. I've created a custom plugin that adds SRI hashes for all inline
script
andstyle
tags in my generated HTML. Some of these scripts include asset urls (which are plumbed in viatemplateParams
). Due to webpack 5's recent introduction of[contenthash]
and theRealContentHashPlugin
, my hash generation now happens at the wrong time (before the hashes are replaced with their final calculated value). This difference between the hash and final outputted content prevents the browser from running the code in these tags.I was able to resolve this by patching
HtmlWebpackPlugin
to modify the stage it itself registers on, but I'd rather not maintain this patch and wonder if this would solve any other problemsDescribe the solution you'd like I'd love to see this registered stage change, or a config param allowing me to specify a custom stage to register on
Describe alternatives you've considered Just owning my patch forever 😄
Additional context n/a