As per issue #38, current use of this with the latest tools ( Webpack 5.65.0 and imagemin-web-webpack-plugin 3.3.6) throws a deprecation warning from Webpack:
_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_ASSETSSTAGE*._
Looking at plugin.js here, in "hookPlugin" there is the code as below (lines 111 etc).
So imagemin-web-webpack-plugin is using PROCESS_ASSETS_STAGE_SUMMARIZE... I guess they want something "earlier", and in any case like the earlier "PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE " sounds like the right place.
I'll see if I can learn enough GitHub to do it myself, but otherwise, can that be done please?
As per issue #38, current use of this with the latest tools ( Webpack 5.65.0 and imagemin-web-webpack-plugin 3.3.6) throws a deprecation warning from Webpack: _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_ASSETSSTAGE*._
Looking at plugin.js here, in "hookPlugin" there is the code as below (lines 111 etc). So imagemin-web-webpack-plugin is using PROCESS_ASSETS_STAGE_SUMMARIZE... I guess they want something "earlier", and in any case like the earlier "PROCESS_ASSETS_STAGE_OPTIMIZE_SIZE " sounds like the right place.
I'll see if I can learn enough GitHub to do it myself, but otherwise, can that be done please?