F
F
freeman02042016-05-28 01:07:36
JavaScript
freeman0204, 2016-05-28 01:07:36

How to make gulp copy only new photos?

The assembly copies all the photos first each time. And what I had

gulp.task('assets', function() {
  return gulp.src(['frontend/assets/{fonts,images}/**', 'frontend/assets/index.html'], {since: gulp.lastRun('assets')})
    .pipe(newer('public'))
    .pipe(gulp.dest('public'));
});

had to copy only what has changed. But for some reason it didn't work.
Is it possible to do something so that when adding photos, they themselves are copied as they are now, but not all, but only new ones?
Here is my task now:
gulp.task('assets', function() {
  return gulp.src('frontend/assets/{fonts,images}/**/*.*')
    .pipe(gulp.dest('public'));
});

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Konstantin Velichko, 2016-06-03
@Zoxon

Try gulp-changed
Works well

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question