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

smartface.io - Proper way to change color scheme for whole application -

Email notification in google apps script -

javascript - three.js lot of meshes optimization -