From d19443d94db39245949d6945ba2d4a112c5ac8c7 Mon Sep 17 00:00:00 2001 From: Maxi Redigonda Date: Mon, 19 Feb 2018 19:43:05 -0300 Subject: [PATCH] Fixes gulp-sass crashes when saving sass files with syntactic errors --- client/gulp/tasks/sass.js | 5 ++++- client/package.json | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/client/gulp/tasks/sass.js b/client/gulp/tasks/sass.js index 02564ed2..fa329d55 100644 --- a/client/gulp/tasks/sass.js +++ b/client/gulp/tasks/sass.js @@ -6,6 +6,7 @@ var gulpif = require('gulp-if'); var browserSync = require('browser-sync'); var autoprefixer = require('gulp-autoprefixer'); var bulkSass = require('gulp-sass-bulk-import'); +var plumber = require('gulp-plumber'); var handleErrors = require('../util/handle-errors'); var config = require('../config'); @@ -13,14 +14,16 @@ gulp.task('sass', function () { return gulp.src(config.styles.src) .pipe(bulkSass()) + .pipe(plumber()) .pipe(sass({ sourceComments: global.isProd ? 'none' : 'map', sourceMap: 'sass', outputStyle: global.isProd ? 'compressed' : 'nested' })) + .on('error', handleErrors) .pipe(autoprefixer("last 2 versions", "> 1%", "ie 8")) .on('error', handleErrors) .pipe(gulp.dest(config.styles.dest)) .pipe(gulpif(browserSync.active, browserSync.reload({ stream: true }))); -}); \ No newline at end of file +}); diff --git a/client/package.json b/client/package.json index 784b2b4d..85ed781b 100644 --- a/client/package.json +++ b/client/package.json @@ -33,6 +33,7 @@ "gulp-if": "^1.2.5", "gulp-imagemin": "^2.3.0", "gulp-notify": "^2.2.0", + "gulp-plumber": "^1.2.0", "gulp-rename": "^1.2.2", "gulp-sass": "^2.0.4", "gulp-sass-bulk-import": "^0.3.2",