Answer the question
In order to leave comments, you need to log in
How to make gulp imagemin take different image formats and put them in different folders?
function image() {
return gulp.src('./source/img/**/*.{jpg,png,gif}')
.pipe(imagemin([
imagemin.gifsicle({interlaced: true}),
imagemin.jpegtran({progressive: true}),
imagemin.optipng({optimizationLevel: 3}),
imagemin.svgo({
plugins: [
{removeViewBox: true},
{cleanupIDs: false}
]
})
]))
.pipe(gulp.dest('./build/img/'))
};
Answer the question
In order to leave comments, you need to log in
Create separate tasks for raster and vector formats, in which to specify the desired end paths
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question