node.js - Why does gulp-watch ignore glob-parameter? -


given following gulpfile.js (simplified), why gulp-watch not exclude 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 tried adding !mongodata/**/*.* in paths.js without success.

gulp.watch expects array of globs first parameter, should write this:

gulp.watch(paths.js.concat(['!mongodata/**/*.*'])) 

Comments

Popular posts from this blog

Email notification in google apps script -

c++ - Difference between pre and post decrement in recursive function argument -

javascript - IE11 incompatibility with jQuery's 'readonly'? -