N
N
Nikolay Semenov2018-05-05 10:45:33
JavaScript
Nikolay Semenov, 2018-05-05 10:45:33

Why does watch fire in this case?

Guys, hello everyone.
Tell me why the watcher launches a task every time ... changes in a certain file seem to be excluded

gulp.task('watch', function() {
  gulp.watch(
    ['./source/template/**/*.pug', './data/_project.json'],
    gulp.series('pug')
  );
  gulp.watch('./source/styles/**/*.scss', gulp.series('sass'));
  gulp.watch(
    ['!./data/_project.json', './data/**/*.json'],
    gulp.series('json')
  ); 
});

the task itself
gulp.task('json', function() {
  return gulp
    .src(['./data/**/*.json', '!./data/*.json'])
    .pipe(
      jsonConcat('./_project.json', function(data) {
        console.log('error');
        return new Buffer(JSON.stringify(data));
      })
    )
    .pipe(gulp.dest('./data'));
});

please help what is wrong?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question