I have a gulp task called assembly, which uses subtasks to move various parts of my source to the assembly folder:
gulp.task('build', ['jshint', 'templates', 'app', 'components', 'stylesheets', 'assets', 'index']); gulp.task('app', ['clean-app'], function(){ return gulp.src(config.inputs.app) .pipe(gulp.dest(config.outputs.root)); });
Then I wanted to add extra steps when --env = prod, which I did with gulp -if:
gulp.task('app', ['clean-app'], function(){ return gulp.src(config.inputs.app) **.pipe(gulpif(env === 'prod', uglify()))** .pipe(gulp.dest(config.outputs.root)); });
It works great. The last thing I want to do is gulp -concat all the js files from these subtasks. I suppose I can use gulpif to return a thread from each task instead of switching to gulp.dest, but I still need to somehow conditionally start the task to combine these threads and concat.
Is there a better way to do this?
gulp
Dan
source share