git - Avoid gulp running a task if file has not changed (multiple user) -
i'm using gulp-changed avoid running task if files didn't change.
the images in assets/images , 1 in dest/images committed in git repository.
the problem when other peoples run task first time regenerate images. images has bit different because git mark theme modified.
how can avoid generating optimizing images **for every user* if original image didn't change.
this i'm using right now
// optimize image , move them in dest folder gulp.task('images', function () { return gulp.src(['assets/images/**']) // take files changed since last time run .pipe(changed(dest + '/images')) .pipe(imagemin({ pngquant: true, progressive: true })) .pipe(gulp.dest(dest + '/images')) });
it make sense see if source images (assets/images/) have changed rather checking dest versions.
i've found gulp-change slow , it's quicker run through them have check first. depends on when , doing it, , how many images have.
Comments
Post a Comment