Answer the question
In order to leave comments, you need to log in
When running Gulp, how to save processed files in the same place where they came from?
Colleagues, I ask you.
There is a code whose task is to shrink images in folders. With automatic penetration into subfolders.
var gulp = require('gulp');
var imagemin = require('gulp-imagemin');
gulp.task('default', function () {
gulp.src('images/**/*')
.pipe(imagemin())
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest(?????))
});
Answer the question
In order to leave comments, you need to log in
gulp.task('images', function() {
gulp.src('./images/**/*.{jpg,jpeg,png,gif}')
.pipe(imagemin({ optimizationLevel: 3, progressive: true, interlaced: true }))
.pipe(gulp.dest('./images'))
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question