Answer the question
In order to leave comments, you need to log in
Gulp task runs 3 times, why?
Good afternoon. There is such a task
gulp.task('img:build', function (cb) {
return gulp.src(['./src/images/**/*.{png,jpg}', '!./src/images/sprites/**/*', '!./src/images/temp/**/*'])
.pipe(tinypng({
key: path.tiny,
sigFile: '.tinypng-sigs',
summarise: true
}))
.pipe(plumber())
.pipe(gulp.dest(path.build.img));
});
gulp.task('watch', function () {
watch(['./src/images/**/*.{png,jpg}', '!./src/images/temp/**/*', '!./src/images/sprites/**/*'], function(event, cb) {
gulp.start('img:build');
});
});
[16:59:09] Starting 'img:build'...
[16:59:09] gulp-tinypng-compress Skipped: 5 images, Compressed: 0 images, Savings: 0.00 B (ratio: 0)
[16:59:09] Finished 'img:build' after 49 ms
[16:59:10] Starting 'img:build'...
[16:59:10] gulp-tinypng-compress Skipped: 5 images, Compressed: 0 images, Savings: 0.00 B (ratio: 0)
[16:59:10] Finished 'img:build' after 9.89 ms
[16:59:10] Starting 'img:build'...
[16:59:10] gulp-tinypng-compress Skipped: 5 images, Compressed: 0 images, Savings: 0.00 B (ratio: 0)
[16:59:10] Finished 'img:build' after 6.41 ms
Answer the question
In order to leave comments, you need to log in
What is the value of the variable path.build.img
? Maybe watcher is watching this directory
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question