From 86e73f087710e3c4affb06a94da1c122a28fe804 Mon Sep 17 00:00:00 2001 From: bryankang Date: Sun, 4 Jun 2017 19:51:56 -0500 Subject: [PATCH] Prevent exiting on css error --- gulpfile.babel.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gulpfile.babel.js b/gulpfile.babel.js index 8aafe62..44a043e 100644 --- a/gulpfile.babel.js +++ b/gulpfile.babel.js @@ -21,6 +21,7 @@ gulp.task("build-preview", ["css", "js", "hugo-preview"]); gulp.task("css", () => ( gulp.src("./src/css/*.css") .pipe(postcss([cssImport({from: "./src/css/main.css"}), cssnext()])) + .on("error", swallowError) .pipe(gulp.dest("./dist/css")) .pipe(browserSync.stream()) )); @@ -63,3 +64,8 @@ function buildSite(cb, options) { } }); } + +function swallowError(error) { + console.error(error.toString()); + this.emit("end"); +}