我想要观察深度嵌套在模板中的所有文件,但在构建之后排除任何文件夹。排除gulp.watch中的子目录
所以排除目录,如:
./templates/foo/build/**/*
./templates/bar/build/**/*
但是包括目录和文件例如:
./templates/foo/template.html
./templates/foo/css/**/*
./templates/bar/template.html
./templates/bar/css/**/*
目前我有成功的分项列记子子文件夹名称和细分子文件类型
gulp.watch(['templates/*/*.html','templates/*/*.js',
'templates/*/*.json','templates/*/css/**/*',
'templates/*/js/**/*'], ['build_templates']);
但我真的希望能够停止更新表达式,每次我添加特定的子子文件夹或子子文件类型。如何包括除了?
我不能得到这个工作。我确实找到了https://www.npmjs.org/package/gulp-grep-stream – jrhicks
这只适用于你安装了gulp-ignore的情况。 –
@SachinGorade错误,你不需要插件来否定glob模式。 –