瀏覽代碼

fix scss watch tasks broken on syntax error

when there is a syntax error in a sass file (theme or core) the npm start command used to hang, forcing the user to stop and restart the task to compile again.
this fix allows to keep the start-task watching/compiling even when there is an error :
- the error is displayed in terminal
- the rest of gulp tasks are not called (no reload in the browser)
- the user can edit the scss files to try a fix without the need to stop/restart the `npm start` command
Thomas Fritsch 1 年之前
父節點
當前提交
f2b0316a91
共有 1 個文件被更改,包括 1 次插入2 次删除
  1. 1 2
      gulpfile.js

+ 1 - 2
gulpfile.js

@@ -167,8 +167,7 @@ function compileSass() {
         file: transformedFile.path,
     }, ( err, result ) => {
         if( err ) {
-            console.log( vinylFile.path );
-            console.log( err.formatted );
+            callback(err);
         }
         else {
             transformedFile.extname = '.css';