0
votes

/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.

1
instead of .pipe(gulp.dest('./app/css/')), can you please try this, .pipe(gulp.dest('./app/css/style.css')) - Code_Ninja
Thanks for getting back to me @Code_Ninja. I tried your suggestion but still not working. - SmokingKipper
are you sure that you have successfully installed the sass module? - Code_Ninja
I think so? I can run the sass function directly and it compiles fine. Only the watch function is causing problems. - SmokingKipper

1 Answers

1
votes

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'));
});