title: Conditional gulp concat on multiple tasks
body: <p>I have a gulp task called build that uses sub-tasks to move various parts of my source to a build folder:</p>
  
  <pre><code>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));
  });
  </code></pre>
  
  <p>I then wanted to add some extra steps when --env=prod, which I did with gulp-if:</p>
  
  <pre><code>gulp.task('app', ['clean-app'], function(){
      return gulp.src(config.inputs.app)
          **.pipe(gulpif(env === 'prod', uglify()))**
          .pipe(gulp.dest(config.outputs.root));
  });
  </code></pre>
  
  <p>This works fine.  The final thing I want to do is to gulp-concat all the js files from those sub-tasks.  I figure that I can use gulpif to return a stream from each task instead of going to gulp.dest, but I would still need to somehow conditionally run a <em>task</em> to combine those streams and concat.</p>
  
  <p>Is there a better way to do this?</p>