且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

延迟吞咽手表

更新时间:2023-02-26 21:52:34

Gulp等待一个>看起来它可能为您工作.将其插入三个任务的顶部.

Gulp-wait looks like it could work for you. Insert it into the top of your three tasks.

gulp.task('watch', function() {
   gulp.watch(config.js.app.pathIn + '/**/*.js', setTimeout(function() {
     gulp.start('scss')
  }, 3000)
});

如果希望使用setTimeout方法,但可能以上工作,但该方法使用gulp.start-从gulp4.0中删除.如果您使用gulp4并在此处对您的任务而不是gulp.start进行函数调用,则要容易得多.

Above might work if you want a setTimeout method but it uses gulp.start - to be removed from gulp4.0. Much easier if you used gulp4 and just made a function call here to your task instead of to gulp.start.

但是我建议等一下.