Closed iiroj closed 2 years ago
IIRC @sokra advised to use that stage. I can't find the discussion now, it might have taken place on Slack. This is perhaps relevant.
There's probably more to be said about it, but first-- what problem are you trying to solve?
Also, have you tried running the test suite after changing the stage? I haven't recently but I bet it breaks.
I was able to resolve my problem by ensuring the order of plugins is such that webpack-subresource-integrity
is the last.
I just think that because plugins in this stage can still edit the contents of assets, it would be conceptually more correct to have this plugin in the next stage where assets should already be finalised.
I was able to resolve my problem by ensuring the order of plugins is such that
webpack-subresource-integrity
is the last.
If you have a test case where this plugin breaks when it's in a different order, I'd appreciate if you could share it. There have been reports in the past (e.g. #79) but I've never been able to reproduce it.
I just think that because plugins in this stage can still edit the contents of assets, it would be conceptually more correct to have this plugin in the next stage where assets should already be finalised.
This plugin does modify assets -- when a chunk lazy-loads other chunks, it embeds the hashes of dependent chunks inside it -- so it's not as straightforward as it might look at first glance.
Thanks for your reply. As per your explanation I now believe it is indeed in the correct stage already, but I might as well fork and try creating a test case for the plugin order anyway.
I'll close the issue for now.
No problem @iiroj, thanks for looking into that test case. Let me know if you run into any troubles writing it, I think you're the first to try since the 5.0 release.
@jscheid I opened a PR with a test demonstrating the issue.
Hello,
I'm looking to integrate this plugin into my workflow, but noticed it's using the
processAssets
hook at thePROCESS_ASSETS_STAGE_OPTIMIZE_INLINE
stage.According to the docs this stage is used to
Would the
PROCESS_ASSETS_STAGE_OPTIMIZE_HASH
stage be a better match, since it's used toThank you for this plugin!