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

Watching all files within a subdirectory #61

Closed
nmagerko opened this issue Aug 18, 2014 · 1 comment
Closed

Watching all files within a subdirectory #61

nmagerko opened this issue Aug 18, 2014 · 1 comment

Comments

@nmagerko
Copy link

I will preface this with the fact that this is my first time using gulp (and, by extension, gulp-watch), so if I am missing something obvious, my apologies in advance!

Anyways, I am currently working on a project that uses Node v. 0.10.3+ and gulp to serve a simple webapp. My gulpfile is as follows (with impertinent components omitted):

var gulp           = require('gulp');
var nodemon        = require('gulp-nodemon');
var watch          = require('gulp-watch');

var paths = {
    server:     "./server.js",
    static: {
        src:    ['./src/static/**'],
        dest:   './dist/public/static/'
    }
};

var copyStatic = function(){
  gulp.src(paths.static.src)
  .pipe(gulp.dest(paths.static.dest));
};

gulp.task('watch', ['serve'], function() {
  watch({ glob: paths.static.src }, copyStatic());
});

gulp.task('serve', function(){
    return nodemon({
    script: paths.server
  });
});

From here, I essentially call the watch task, which I expect to watch for changes in './src/static/**', and (if it finds any changes) copy everything below static over to './dist/public/static'. However, I have noticed that adding a file to './src/static/img/', for example, does not cause anything to happen at all (no console output either). In other tasks, I use specific blobs like './src/js/*.js', and everything works perfectly.

Is this feature of watching all files within a subdirectory available, or am I simple using it incorrectly?

@floatdrop
Copy link
Owner

Thanks for reporting, but this is known issue and it should be fixed in near future in gaze.

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

No branches or pull requests

2 participants