1

Here is my code:

gulp.task('sass', function () {
    gulp.src('./public/stylesheets/*.scss')
        .pipe(sass())
        .pipe(gulp.dest('./public/stylesheets/'));
});

gulp.task('watch-saas', function () {
    watch('./public/stylesheets/*.scss', function () {
        gulp.start('sass');
    });
});

Output:

[19:15:46] Using gulpfile ~/WebstormProjects/mySite/gulpFile.js
[19:15:46] Starting 'watch-saas'...
[19:15:46] Finished 'watch-saas' after 38 ms

Im afraid no CSS. Any ideas how to make this work?

I think my code looks very much like the example code here. And the 'sass' task runs fine on its own.

4

2 に答える 2

2

私は Gulp の経験が豊富ではありませんが、通常は以下を使用します。

gulp.task('watch-saas', function () {
    return gulp.watch(['./public/stylesheets/*.scss'], ['sass']);
});

非同期タスクであるため、タスクで結果を返す必要があると思います。

于 2014-12-07T19:13:36.863 に答える