Answer the question
In order to leave comments, you need to log in
How to properly configure imagemin?
I decided to get acquainted with imagemin (I used to use tinypng in the browser, but then the number of images increased dramatically). I was not very satisfied with the default compression level, I decided to raise it. But here everyone contradicts each other:
1 - Docks of imagemin itself:
.pipe(imagemin([
imagemin.optipng({optimizationLevel: 5}),
]))
Note that you may come across an older, implicit syntax. In versions < 3, the same was written like this:
.pipe(imagemin({
optimizationLevel: 5,
const imageminOptipng = require('imagemin-optipng');
imagemin(['images/*.png'], 'build/images', {use: [imageminOptipng()]}).then(() => {
console.log('Images optimized');
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question