2

I'm use gulp. I have a task

gulp.task('watch', function () {
    gulp.watch(['app/**/*.js'], ['scripts']);
});

I have same folder structure:

  • app
    • modules
      • admin
        • adminCtrl.js
      • home
        • homeCtrl.js
  • app.js

If I add file *.js or new subdirectory, for example, into 'modules/admin', gulp watch working, but, if I create new subdirectory in modules/, for example, 'about', and add into 'about' file, for example, aboutCtrl.js, gulp watch is not working. How I can fix this problem?

kalash23
  • 56
  • 7

1 Answers1

2

I'd say your best option is to go ahead and rerun Gulp infrequently or after you add new directories. Seems like the 'gaze' library behind gulp-watch has issues related to this which they plan to resolve in a upcoming release. Ref: https://github.com/shama/gaze/issues/70

stealthwang
  • 915
  • 6
  • 8
  • Yes, this is exactly what interests me. Only it is not clear how soon they will be able to fix it. – kalash23 Jan 04 '15 at 19:04
  • 1
    Those are concerns probably best handled in the gaze issue tracker. Not sure anyone on StackOverflow will be able to help you with a bug in a piece of software you don't maintain, beyond suggesting you avoid the bug entirely. – stealthwang Jan 04 '15 at 19:28
  • manually restart gulp or certain tasks. Other variations and does not remain. So while it is indeed the best. Thank U – kalash23 Jan 04 '15 at 19:51