Search code examples
csssassgulpgulp-sass

Gulp run function doesn't appear to be working


/app

index.html

--/sass

----style.scss

--/css

----style.css

Gulp CLI version 2.0.1 and Local version 4.0.0

Running gulp sass correctly runs the sass function and compiles my sass file. Running gulp sass:watch starts the watch...

images of gulp watch running

If I change some styles within the style.scss and save the file I get:

enter image description here

but no changes are propagated to css/style.css.

gulp.task('sass', function() {
    return gulp.src('./app/sass/style.scss')
            .pipe(sass())
            .pipe(gulp.dest('./app/css/'))
});

gulp.task('sass:watch', function() {
    gulp.watch('./app/sass/*.scss', gulp.series(sass));
});

Any help would be greatly appreciated.


Solution

  • if think you just forgot two ' around 'sass' in gulp.series

    gulp.task('sass', function() {
      return gulp.src('./app/sass/style.scss')
        .pipe(sass())
        .pipe(gulp.dest('./app/css/'));
    });
    
    gulp.task('sass:watch', function() {
      gulp.watch('./app/sass/*.scss', gulp.series('sass'));
    });