I'm currently exploring different methods to effectively compress my images using webpack. Specifically, I am interested in compressing .jpg files (lossy), .png files, and also generating .webp files for each jpg/png file.
Although I have experimented with https://github.com/itgalaxy/imagemin-webpack which has successfully compressed .jpg and .png files, unfortunately, I have not been able to generate .webp files despite its claim of supporting other imagemin packages.
Here is my current configuration for this plugin:
const imageMinPlugin = new ImageminPlugin({
imageminOptions: {
plugins: [
['webp', { quality: 50 }],
['mozjpeg', { quality: 10 }],
['pngquant', { quality: [0.9, 0.95]}],
]
}
});
However, it seems that the "webp" aspect is being overlooked without any indication or error messages. I am curious if there exists a more efficient method to compress images using webpack that aligns with my requirements, or if there is an alternative approach I should consider?