I have updated my image-minimizer-webpack-plugin
package from version 2 to 3 and looking at their documentation, I first installed imagemin
package and then updated my webpack.config.js
. In version 2, I had the following in my config file:
new ImageMinimizerPlugin({
minimizerOptions: {
plugins: [
["gifsicle", { interlaced: true }],
["jpegtran", { progressive: true }],
["optipng", { optimizationLevel: 5 }]
],
},
})
That throws the following error.
options has an unknown property 'minimizerOptions'
Looking at their documentation, I changed that to this:
new ImageMinimizerPlugin({
minimizer: {
implementation: ImageMinimizerPlugin.imageminMinify,
options: {
plugins: [
["gifsicle", { interlaced: true }],
["jpegtran", { progressive: true }],
["optipng", { optimizationLevel: 5 }]
],
},
},
})
Now I am getting this warning:
"imageminMinify" function do not support generate to "jpg". Please use "imageminGenerate" function.
When I use imageminGenerate
instead of imageminMinify
, then the images (jpeg files) don't load at all. Any idea what I need to do/change? Thanks in advance.