gulp-sass: not working with gulp 4.0

Task did not finish Starting gulpSass…


var gulp = require('gulp');
var sass = require('gulp-sass');

var paths = {
  sass:    'src/css/**/*.scss',
 };
gulp.task('sass', function () {
  return sass(paths.sass)
    .on('error', sass.logError)
    .pipe(gulp.dest('src/css'));
});
function watch() {
  livereload.listen();
  ...
  gulp.watch(paths.sass, sass);
}

gulp.task('build',  gulp.parallel(sass, ... watch));

gulp.task('default', gulp.series('build'));

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 22

Most upvoted comments

@TeodorKolev I wanted to post the actual issue (in case you hadn’t resolved it)…

You are actually calling gulp-sass (the npm module, which is not a gulp task) directly, instead of the sass task. Try naming you sass task something different and it will complete properly. Hope that helps anyone who made the same mistake and ends up here!