【问题标题】:Gulp-watch issueGulp-watch 问题
【发布时间】:2018-03-26 17:42:28
【问题描述】:

我在使用 gulp-watch 时遇到了一个小问题。当我更改样式文件夹(.css 文件)中的某些内容时,手表不会触发。我只是不想将副本写入另一个文件夹。 html 任务工作正常,但 css 不会触发。如果这有什么不同的话,我在 ubuntu 中所做的所有编程也是如此。

    var gulp = require('gulp');

    gulp.task('html', function(){
        console.log("Changes have been made to the html file!");
    });

    gulp.task('styles', function(){
         return gulp.src('./app/assets/styles/styles.css').pipe(gulp.dest('./app/assets/temp/styles'));
    });


    gulp.task('watch', function() {

        gulp.watch('./app/index.html', function(){
            gulp.start('html');
        });

        gulp.watch('app/assets/styles/**/*.css'), function(){
            gulp.start('styles');
        };
   });

【问题讨论】:

    标签: gulp gulp-watch


    【解决方案1】:

    解决了。我有一个额外的)在:

    'app/assets/styles/**/*.css') <<<<
    

    【讨论】:

      猜你喜欢
      • 2018-08-14
      • 1970-01-01
      • 1970-01-01
      • 2020-05-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-26
      相关资源
      最近更新 更多