I am currently in the process of converting my sass files to css and encountering some issues. Specifically, I am struggling with handling errors during the sass conversion process. Whenever there is an error, it causes gulp to hang, requiring me to restart the process. As someone who frequently makes typos and saves my work religiously with ctrl+s, this becomes incredibly frustrating. Here is the code snippet that I am working with:
gulp.task('default', function () {
var sassSrc = './src/scss/*.scss',
sassDst = './build/css',
htmlSrc = './src/*.html',
htmlDst = './build';
gulp.src(sassSrc, {unpipeOnError: false})
.pipe(watch(function(files) {
return files.pipe(plumber())
.pipe(sass())
.on("error", notify.onError())
.pipe(prefix("last 3 version", "> 1%", 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', "Android 4"))
.pipe(minifyCSS())
.pipe(gulp.dest(sassDst))
.pipe(notify({ message: 'Styles task complete' }));
}));
gulp.src(htmlSrc)
.pipe(watch(function(files) {
return files.pipe(minifyHTML())
.pipe(gulp.dest(htmlDst));
}));
});