Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New files in empty or new directory are not watched #56

Closed
thebuilder opened this issue Jul 28, 2014 · 7 comments
Closed

New files in empty or new directory are not watched #56

thebuilder opened this issue Jul 28, 2014 · 7 comments
Labels

Comments

@thebuilder
Copy link

I've noticed an issue when creating new files.

I'm using the following watch, to look for all .less files in my src directory.

watch({glob: config.src + '**/*.less', name: 'LESS', emitOnGlob: false}, ['less'])

This works as expected, and new .less files gets detected.
Unless i create a .less file in an existing subdirectory that did not contain any .less files at the watch start. The files will not be detected before i restart the watch.

Is this an issue with globbing in general? If so, any idea of how to work around it?

@floatdrop
Copy link
Owner

Could you try to add current directory to glob option? Like this: glob: [config.src + '/*.less', config.src + '**/*.less'].

@thebuilder
Copy link
Author

Sadly didn't work. Just resulted in any new directories in the src directory triggering the watch. But it has no effect on files created in an existing subdirectory.

@floatdrop
Copy link
Owner

This issue belongs to gaze unfortunately - shama/gaze#103

@floatdrop floatdrop added the gaze label Sep 5, 2014
@floatdrop floatdrop changed the title New filetype in existing subdirectory New files in empty or new directory are not watched Oct 21, 2014
@floatdrop
Copy link
Owner

@thebuilder [email protected] now uses chokidar, that fixes this issue.

@thebuilder
Copy link
Author

Awesome!


Fra: Vsevolod Strukchinskymailto:[email protected]
Sendt: ý21-ý01-ý2015 19:23
Til: floatdrop/gulp-watchmailto:[email protected]
Cc: Daniel Schmidtmailto:[email protected]
Emne: Re: [gulp-watch] New files in empty or new directory are not watched (#56)

@thebuilderhttps://github.com/thebuilder [email protected] now uses chokidar, that fixes this issue.


Reply to this email directly or view it on GitHubhttps://github.com//issues/56#issuecomment-70891967.

@OlivierCuyp
Copy link

OlivierCuyp commented Jul 6, 2016

Still have the issue with empty folder.
Here is my code :

gulp.task('clean:images', function () {
  return del.sync([
    config.img.out + '/**'
  ]);
});

gulp.task('bundle:images', ['clean:images'], function () {
  return gulp.src('assets/img/**/*.*')
    .pipe(gulp.dest('dist/img'));
});

gulp.task('watch:images', ['bundle:images'], function () {
  return gulp.watch('assets/img/**/*.*', ['bundle:images']);
});

Working fine as soon there is a file in assets/img.

@UltCombo
Copy link
Collaborator

UltCombo commented Jul 6, 2016

@OlivierCuyp Are you actually using the gulp-watch package? Looks like you are using gulp's built-in gulp.watch method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants