gulp-imageoptim icon indicating copy to clipboard operation
gulp-imageoptim copied to clipboard

doesn't work with watch

Open cavico opened this issue 9 years ago • 1 comments

Every time I use gulp watch with ImageOptim, it multiply the length of files by itself. For example:

  • 2 new files, it try to minify 4 files;
  • 3 new files, it try to minify 9 files;
  • 4 new files, it try to minify 16 files;

It only work well with one file per time.

My task: gulp.watch(['src/images/**/*'], function(event) { return gulp .src('./src/images/**/*.{png,gif,jpg}') .pipe(imageOptim.optimize()) .on('error', function (error) { console.error(String(error)); }) .pipe(gulp.dest('./dist/img')); });

Would you find out what it can be?

Thanks!

cavico avatar Mar 07 '16 13:03 cavico

Thank you for bringing this to my attention. I will look into it.

allbitsnbytes avatar Mar 14 '16 15:03 allbitsnbytes