stream - Gulp streamqueue sass plumber watch. Errors breaks task -


have problem occurs gulp task using streamqueue, sass, plumber , watching @ end. task compiling production css-file vendors css|scss files own.

gulp.task('fincss', function () {     watch([workdata.sasssrcfiles, workdata.cssvendorsrcfiles], {}, function () {         var convertfromscsstocssandconcat =             gulp.src(workdata.sasssrcfiles)                 .pipe(plumber(error))                 .pipe(sass());          var minifyandconcatexistingcss =             gulp.src(workdata.cssvendorsrcfiles)                 .pipe(plumber(error));          return sq({objectmode: true}, minifyandconcatexistingcss, convertfromscsstocssandconcat)             .pipe(concat('final.min.css'))             .pipe(uglifycss())             .pipe(gulp.dest(workdata.cssdest))             .pipe(livereload());     }); });  var error = function (e) {     console.error('error in plugin "' + e.plugin + '"');     console.error('   "' + e.message + '"');     console.error('   in file "' + e.filename + '", line "' + e.linenumber + '".');     console.log('--------------------------------------');     console.log(e); }; 

but when error in scss file breaking task. , experiments plumber provides in internet doesn't helps me anyway. inserting plumber() before concat, or using this.emit('end') in error handler nothing.

in other tasks

gulp.task('tohtml', function () {     watch(workdata.pugsrcfiles, {}, function (e) {         message('start generating template.');         gulp.src([workdata.pugsrcfiles, '!' + workdata.pugsrc + '_*.pug'])             .pipe(plumber(error))             .pipe(pug({pretty: true}))             .pipe(gulp.dest(pubdir))             .pipe(livereload());     }); }); 

all works pretty , without breaking task.

help, please.

you can use stream-series replace streamqueue.

change config file to:

var series = require('stream-series');  gulp.task('fincss', function () {     watch([workdata.sasssrcfiles, workdata.cssvendorsrcfiles], {}, function () {         var convertfromscsstocssandconcat =             gulp.src(workdata.sasssrcfiles)                 .pipe(plumber({errorhandler: function(error) {                      convertfromscsstocssandconcat.emit('end')  // important                  }}))                 .pipe(sass());          var minifyandconcatexistingcss =             gulp.src(workdata.cssvendorsrcfiles)                 .pipe(plumber(error));          return series(minifyandconcatexistingcss, convertfromscsstocssandconcat)             .pipe(concat('final.min.css'))             .pipe(uglifycss())             .pipe(gulp.dest(workdata.cssdest))             .pipe(livereload());     }); 

});


Comments