Combine two sips into one
2 answers
The recommended way to do it: lazypipe according to gulp-if
the documentation itself :
Lazypipe creates a function that initializes the pipe chain when used. This allows you to chain events inside a gulp-if condition.
In this example:
gulp.task('app-scripts', function() {
return getEnvScriptsStream()
.pipe(gulpif(stgOrProd(), lazypipe().pipe(uglify).pipe(concat, 'embed')()))
.pipe(gulp.dest(paths.js))
.pipe(connect.reload());
});
+2
source to share