brotli-webpack-plugin
brotli-webpack-plugin copied to clipboard
Fix: Use safe compilation hooks to prevent deprecation warning
I was working on improving my Webpack build performance and faced this warning, just took a look at brotli-webpack-plugin
source codes and had it fixed by putting it in the right compilation stage.
95% emitting emit BrotliPlugin(node:438254) [DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated.
BREAKING CHANGE: No more changes should happen to Compilation.assets after sealing the Compilation.
Do changes to assets earlier, e. g. in Compilation.hooks.processAssets.
Make sure to select an appropriate stage from Compilation.PROCESS_ASSETS_STAGE_*.
(Use `node --trace-deprecation ...` to show where the warning was created)
Also, kept old codes in case someone uses this plugin with older versions of Webpack to make sure this breaks nothing.
Guys, I need this fix. When you will update the plugin? Many thanks!
I'm also waiting for this fix ... any chance you could review it @mynameiswhm ?
Actually, nevermind... I noticed compression-webpack-plugin has brotli support now so I just switched to that.