Klathmon / imagemin-webpack-plugin

Plugin to compress images with imagemin
MIT License
684 stars 53 forks source link

[DEP_WEBPACK_COMPILATION_ASSETS] DeprecationWarning: Compilation.assets will be frozen in future, all modifications are deprecated #116

Open doberkofler opened 4 years ago

doberkofler commented 4 years ago

When running on webpack 5.1.0 the following deprecation message is shown:

~/MyDev/ljs_app/trunk/desktop/ttr/web $ node --trace-deprecation node_modules/webpack/bin/webpack.js
(node:19838) [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_*.
    at ImageminPlugin._callee2$ (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/imagemin-webpack-plugin/dist/index.js:264:48)
    at tryCatch (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:62:40)
    at Generator.invoke [as _invoke] (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:296:22)
    at Generator.prototype.<computed> [as next] (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:114:21)
    at step (/Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/babel-runtime/helpers/asyncToGenerator.js:17:30)
    at /Users/doberkofler/MyDev/ljs_app/trunk/desktop/ttr/web/node_modules/babel-runtime/helpers/asyncToGenerator.js:28:13
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
doberkofler commented 3 years ago

I was just wondering, if this issue might get fixed or rather not?

waltercruz commented 3 years ago

It's probably better to change to image-minimizer-webpack-plugin now...

alexander-akait commented 3 years ago

Yep, please migrate on image-minimizer-webpack-plugin https://github.com/webpack-contrib/image-minimizer-webpack-plugin, also in near future we will do new release with https://github.com/GoogleChromeLabs/squoosh so you don't need compiled imagemin native dependencies