Answer the question
In order to leave comments, you need to log in
Why does gulp-imagemin increase photo weight?
Here is the task:
const { src, dest } = require('gulp')
const imagemin = require('gulp-imagemin')
const imageminPlugins = [
imagemin.gifsicle({
optimisationLevel: 3
}),
imagemin.optipng({
optimizationLevel: 3
}),
imagemin.mozjpeg({
progressive: true,
quality: 100
}),
imagemin.svgo({
plugins: [
{ removeViewBox: false },
{ removeUnusedNS: false },
{ removeUselessStrokeAndFill: false },
{ cleanupIDs: false },
{ removeComments: true },
{ removeEmptyAttrs: true },
{ removeEmptyText: true },
{ collapseGroups: true }
]
})
]
module.exports = function images () {
return src('./src/assets/images/**/*')
.pipe(imagemin(imageminPlugins))
.pipe(dest('./dist/assets/images'))
}
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