Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • G gulp
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 24
    • Issues 24
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gulp
  • gulp
  • Issues
  • #531
Closed
Open
Issue created Jun 14, 2014 by Administrator@rootContributor

Every `gulp.watch` listener fires on every file change

Created by: lynndylanhurley

For example, when I save a coffeescript file, it triggers all of the tasks for all of the other watchers. Same with any other type of file. Any change will trigger all of the watchers.

The watch code is here:

  // Watch for changes in .tmp folder, reload the browser
  gulp.watch([
    '.tmp/*.html',
    '.tmp/styles/**/*.css',
    '.tmp/scripts/**/*.js',
    '.tmp/images/**/*.*'
  ], function(event) {
    console.log('@-->caught change in file', event);

    gulp.src(event.path, {read: false})
      .pipe($.livereload(lr));
  });

  // Watch .scss files
  gulp.watch('app/styles/**/*.scss', ['sass']);

  // Watch .styl files
  gulp.watch('./app/styles/**/*.styl', ['stylus']);

  // Watch sprites
  gulp.watch('app/images/sprites/**/*.png', ['sprites']);

  // Watch .js files
  gulp.watch('app/scripts/**/*.js', ['js']);

  // Watch .coffee files
  gulp.watch('./app/scripts/**/*.coffee', ['coffee']);

  // Watch .jade files
  gulp.watch('app/index.jade', ['base-tmpl']);
  gulp.watch('app/views/**/*.jade', ['reload-js-tmpl']);

  // Watch image files
  gulp.watch('app/images/**/*', ['images']);

  // Watch bower files
  gulp.watch('app/bower_components/*', ['bowerjs', 'bowercss']);

I just started experiencing this problem with a yeoman generator that I built.

The strange thing is that older projects built using this generator do not exhibit this behavior.

I tried updating all of the dependencies to the most recent versions, but it did not solve the issue.

The generator is here: https://github.com/lynndylanhurley/generator-gulp-of-drano

Assignee
Assign to
Time tracking