0

Given the following gulpfile.js (simplified), why does gulp-watch not exclude the mongoData-folder?

'use strict';

var gulp = require('gulp'),
  paths = {
    js: ['*.js', 'test/**/*.js', '!test/coverage/**', '!bower_components/**', '!packages/**/node_modules/**', '!packages/contrib/**/*.js', '!packages/contrib/**/node_modules/**', '!packages/core/**/*.js', '!packages/core/public/assets/lib/**/*.js']
  };

gulp.task('watch', function () {
  gulp.watch([paths.js, '!mongoData/**/*.*']).on('change', plugins.livereload.changed);
});

I also tried adding !mongoData/**/*.* in paths.js without success.

Tobias Mühl
  • 1,788
  • 1
  • 18
  • 30

1 Answers1

0

gulp.watch expects an array of globs as the first parameter, you should write like this:

gulp.watch(paths.js.concat(['!mongoData/**/*.*']))
Magomogo
  • 954
  • 4
  • 13