E
E
Econavi2017-06-05 20:27:43
gulp.js
Econavi, 2017-06-05 20:27:43

Why doesn't {since: gulp.lastRun('…')} skip changed files?

Hello!
I am using gulp 4 .
I just can't figure out why {since: gulp.lastRun('...')} doesn't pass changed files into the stream.
I add, rename files, gulp.watch works, but there are 0 files in the stream .
Without since everything works correctly.
Tell me, what could be the matter?

gulp.task('assets', function() {
  return gulp.src('app/assets/**', {since: gulp.lastRun('assets')})
  .pipe(gulp.dest('public'));
});

gulp.task('watch', function() {
  gulp.watch('app/assets/**/*.*', gulp.series('assets'));	
});

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Oleg, 2017-06-05
@werty1001

Since looks at the time of the last. changes, if you just renamed the file, then it will not be taken into account, in the case of statics, you need to change the change time with handles, you can see an example in my BemGo assembly .

E
Econavi, 2017-06-06
@Econavi

I agree with you about the name change.
But, when adding a new file, should it skip it?
The styling task skips new, empty files.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question