Gulp 4.0忽略手表不工作

Gulp 4.0忽略手表不工作,gulp,gulp-watch,Gulp,Gulp Watch,我有以下代码: gulp.task('watch:Feature', function() { gulp.watch(['./js/Feature/**/*.ts', '!./js/Feature/.gulp-tsc-tmp*.ts'], function () { console.log("Test"); }); }); 我已将typescript构建任务替换为console.log(“Test”),并将名为.gulp-tsc-tmp-1151023-9976-e1

我有以下代码:

 gulp.task('watch:Feature', function() {
        gulp.watch(['./js/Feature/**/*.ts', '!./js/Feature/.gulp-tsc-tmp*.ts'], function () { console.log("Test"); });
    });
我已将typescript构建任务替换为
console.log(“Test”)
,并将名为
.gulp-tsc-tmp-1151023-9976-e1a1h3.ts的文件复制到
Feature
目录中,从而将“Test”输出到控制台

我尝试了各种排除模式,包括指定要复制到目录中的确切文件名,但似乎都不起作用


忽略带有特定前缀的文件的正确方法是什么?

几周前,我遇到了这个问题,并被告知该功能已被删除,我没有时间确定这是否属实,但我以前工作的“忽略”肯定没有一个在更新版本上工作。

我也遇到了这个问题,并通过从我的路径开始删除“/”来解决此问题:

gulp.task('watch:Feature', function() {
    gulp.watch(['js/Feature/**/*.ts', '!js/Feature/.gulp-tsc-tmp*.ts'], function () { console.log("Test"); });
});

在gulp 4中忽略手表中文件的正确方法是:

gulp.watch('js/Feature/**/*.ts', {
    ignored: 'js/Feature/.gulp-tsc-tmp*.ts'
}, function () {
    console.log('Test');
});