1
當我對.jade
文件進行更改時,我想要Gulp
任務僅對該文件運行,而不是針對所有文件運行。爲此,我正在使用gulp-changed
。它工作正常,直到我更改影響全局佈局的文件,例如_header.jade
,_layout.jade
。當我對該文件進行更改時,沒有任何反應。標題之前,我所有的佈局文件都有_
。我該如何解決這個問題?使用Jade特性與gulp改變?
這是我gulpfile一些線
gulp.task('jade', function() {
return gulp.src('dev/templates/**/!(_)*.jade')
.pipe(plumber({
errorHandler: onError
}))
.pipe(changed('public', {extension: '.html'}))
.pipe(jade({
pretty: true,
}))
.pipe(gulp.dest('public'))
.pipe(browserSync.reload({
stream: true
}));
});
gulp.task('watch', function() {
gulp.watch('dev/templates/**/*.jade', gulp.series('jade'));
});