Max Schmitt

February 27 2014

gulp-watch and watching new files

Gulp.js is an awesome tool for running build tasks. The watch-plugin is really easy to use and works great.

However: by default, watch will not consider any new files that you add while watch is already running. To fix this, you can set the options.glob-parameter:


.pipe(watch({ glob: 'src/js/**/*.js' }, function() {

With this configuration, gulp will watch all files that match src/js/**/*.js and automatically add any new files with that pattern to watch.


gulp now includes watch functionality by default, it's easier to setup, but it doesn't pickup when new files are added:'src/js/**/*.js', ['browserify']);