Skip to content

doesn't work with watch #7

@cavico

Description

@cavico

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions