Answer the question
In order to leave comments, you need to log in
How to force gulp to rebuild only changed files?
gulp.task('build-images', function () {
gulp.src('src/design/images/**/*.png')
.pipe(imagemin({
progressive: true,
svgoPlugins: [{removeViewBox: false}],
use : [pngquant()],
interlaced : true
}))
.pipe(gulp.dest('build/design/images/'));
});
gulp.task('default', ['browser-sync'], function () {
gulp.watch(['src/design/images/**/*.*'], ['build-images']);
});
Answer the question
In order to leave comments, you need to log in
Changed is not always suitable, I use .on('change' ... ) in gulp.watch and immediately throw only the changed file into .pipe
https://urn.su/IT/gulp/watch_on_change.php
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question