Gulp-watch is not picking up new files

前端 未结 1 1327
南旧
南旧 2021-02-14 07:39

I\'m trying to run a task whenever a file get\'s changed, delete or a new file is added. The first two work, however: when a new file is added it\'s not being picked up.

1条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-14 08:26

    That was a weird problem. Removing ./ from glob fixes it.

    var gulp  = require('gulp');
    var watch = require('gulp-watch');
    
    gulp.task('watch', function() {
        watch(['src/Scripts/**/*.js'], function(event, cb) {
            console.log('test');
            cb();
        });
    });
    

    0 讨论(0)
提交回复
热议问题