[英]gulp.watch() not working with jade
突然,我所有的玉石文件的gulpfile.js的watch語句停止工作。 你知道為什么嗎?
玉器任務:
gulp.task('jade', function() {
gulp.src('app/*.jade')
.pipe(jade())
.on('error', function(err) {
console.log(err)
this.emit('end')
})
.pipe(minifyHTML())
.pipe(gulp.dest('dist/'))
.pipe(browserSync.stream())
})
我還使用BrowserSync,因此我將所有watch語句放入serve
任務中,如下所示:
gulp.task('serve', ['styles', 'html', 'jade', 'scripts'], function() {
browserSync.init({
server: './dist'
})
gulp.watch('app/css/**/*.sass', ['styles'])
gulp.watch('app/*.jade').on('change', function() {
gulp.run(['jade'])
browserSync.reload()
})
gulp.watch('app/src/*.js', ['scripts'])
})
另外,所有其他監視語句都有效,因此我真的不知道發生了什么。 謝謝您的幫助!
如果沒有代碼更改,但突然停止工作,則需要檢查一些事項。
如果您使用的是node和npm:
npm install
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.