代码之家  ›  专栏  ›  技术社区  ›  AnchovyLegend

吞表不触发

  •  0
  • AnchovyLegend  · 技术社区  · 7 年前

    运行时 gulp ,所有运行成功。

    但是,现在我需要在编译的vue文件上添加一个观察程序,如下所示。

    gulp.task('watch', ['scripts'], function() {
        gulp.watch('js/vue/compiled.js', { ignoreInitial: false });
    });  
    

    虽然watcher进程似乎启动了,但它不会在编译的.js文件更新时更新。知道为什么吗?

    2 回复  |  直到 7 年前
        1
  •  2
  •   SuperStar518 JamesE    7 年前

    通常我是怎么写的 吞咽任务

    gulp.task('watch', function() {
        gulp.watch('js/vue/compiled.js', ['scripts'], { ignoreInitial: false });
    });
    
        2
  •  1
  •   moigonz    7 年前

    与其将gulp函数放在gulp.task中执行,不如将其放在gulp.watch中。像这样:

    gulp.task('watch', function() {
        gulp.watch('js/vue/compiled.js', ['scripts'], { ignoreInitial: false });
    });