【发布时间】:2016-12-18 11:28:34
【问题描述】:
是的,我的 gulpfile (gulp@3.9.1) 中的 sass 报告了许多错误(并继续监视,就像它应该做的那样......),但不是这样的错误:
=clearfix()
&:after
content: ""
display: table
clear both
content 和 display 使其正确进入实际类(其中引用了 mixin),但 clear 没有(因为我错过了冒号)。这是一个语法错误(所以它不像rareproperty: 42px; 处理得很好)。 → 静止:没有发现错误,没有中断。
我的吞咽任务:
gulp.task('sass', function() {
return gulp.src(src.scssMaster)
.pipe(plumber())
.pipe(sourcemaps.init())
.pipe( sass({
debugInfo : true,
lineNumbers : true,
outputStyle: 'expanded'
})
.on('error', function(err){
gutil.log(err); // stackoverflow.com/a/30742014/444255
this.emit('end');
})
)
.pipe(autoprefixer({
browsers: ['iOS >= 5', 'ie 8', 'Firefox > 2'],
cascade: true,
remove: true
}))
.pipe(rename('lznet.css'))
.pipe(sourcemaps.write('../maps'))
.pipe(gulp.dest(src.cssDir))
.pipe(reload({stream: true}))
.on('end', () => gutil.log('sass thing done'));
});
千禧一代❤
【问题讨论】:
标签: error-handling sass gulp gulp-watch gulp-sass