Merge pull request #159 from mredigonda/gulp-sass-fix
Fixes gulp-sass crashes when saving sass files with syntactic errors
This commit is contained in:
commit
d05a398ea8
|
@ -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 })));
|
||||
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue