treehouse-gulp-basics
treehouse-gulp-basics copied to clipboard
SASS error interrupts watchFiles function
Not sure what I am missing, I am using the same gulpfile/folder structure and whenever there is a sass error it stops watchFiles function.
I experienced the same issue and solved it by using "on('error')" like the below example:
gulp.task("compileSass", function () {
gulp.src('app/styles/**/*.scss')
.pipe(maps.init())
.pipe(sass({
outputStyle: 'expanded'
})
.on('error', sass.logError))
.pipe(maps.write("./"))
.pipe(gulp.dest('app/styles'));
});
i am very new at this so i dont know exactly why it keeps running - but it does :). I am guessing it is because it runs sass.logError upon something going wrong but it does not write anything to the console.
take a look at this stackoverflow question for more info:
http://stackoverflow.com/questions/21080433/gulp-sass-watch-stops-when-invalid-property-name