I\'m having a problem with gulp
. I run gulp-watch
along with gulp-less
and gulp-clean
. Everything is running perfectly.
the best solution I have tried; https://github.com/gulpjs/gulp/blob/master/docs/recipes/combining-streams-to-handle-errors.md
var combiner = require('stream-combiner2');
gulp.task('multi:less', function(done) {
var combined = combiner.obj([
gulp.src(srcs),
less(),
autoprefixer({
browsers: ['last 6 versions'],
cascade: false
}),
isDev ? null : cleanCss(),
gulp.dest(targetDir + 'css/multi/'),
].filter(v => v));
// any errors in the above streams will get caught
// by this listener, instead of being thrown:
combined.on('error', console.error.bind(console));
combined.on('end', () => {}); //done have been call when return combined;
return combined;
}