javascript - gulp watch only runs twice -


i'm in process of switching grunt gulp. working find under grunt (mentioning in case helps).

with gulpfile below test task (mocha) run when file changes, works twice. if change file, task run, successive changes same file don't trigger run. in other words:

  • touch file a, task runs
  • touch file again, task runs
  • touch file again, task doesn't run
  • touch file b, task runs
  • touch file b again, task doesn't run

the test passes , output see gulp start/stop (i.e. i'm not seeing errors break watch)

osx 10.10.3 / gulp 3.9.0

my gulpfile:

'use strict';  var gulp = require('gulp'); var mocha = require('gulp-mocha');  gulp.task('test', function() {     gulp.src('test/unit/**/*.js')         .pipe(mocha()); });  gulp.task('watch', function() {     gulp.watch('lib/**/*.js', ['test']); }); 

it's weird , don't know why same thing happened me , started working once started watching test files too. maybe work in case. give try.

gulp.task('watch', ['test'], function() {     gulp.watch(['lib/**/*.js', 'test/unit/**/*.js'], ['test']); }); 

Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -