title: How can i combine two gulp tasks
body: <p>I am using <code>gulp</code> to compile my typescript files and create the <code>output.js</code> file. </p>
  
  <p>Is it possible to have a single task which compiles typescript file and concatenates it with angular libraries? </p>
  
  <p>Here's what my current file looks like (below). First it's running a typescript task which creates the <code>output.js</code> file and then it runs a scripts task which concats the script plugin files and <code>output.js</code>. </p>
  
  <pre><code>'use strict';
  var gulp = require('gulp')
  
  var paths = {
    distScriptsDir: '../../Themes/mastter/Scripts',
    srcScriptsPlugins: [
      'node_modules/jquery/dist/jquery.min.js',
      'node_modules/angular/angular.min.js',
      'node_modules/angular-route/angular-route.min.js',
      'node_modules/angular-translate/dist/angular-translate.min.js',
      'node_modules/angular-translate/dist/angular-translate-loader-url/angular-translate-loader-url.min.js',
      'node_modules/angular-bootstrap/dist/ui-bootstrap-tpls.js',
      'Scripts/angular-sticky.min.js',
      'Scripts/dragme.js',
      'Scripts/jasny-bootstrap.min.js',
      'node_modules/lodash/dist/lodash.min.js',
      'node_modules/angular-google-maps/dist/angular-google-maps.min.js'
    ],
    srcScriptsFile: [
      'output.js'
    ]
  };
  
  
  //typescript
  gulp.task('typescript', function () {
    var ts = require('gulp-typescript');
    var tsResult = gulp.src( 'all.ts')
      .pipe(ts({
        noImplicitAny: true,
        out: 'output.js'
      }));
    return tsResult.js.pipe(gulp.dest(''));
  });
  
  // scripts task
  gulp.task('scripts', function () {
  
    var concat = require('gulp-concat'),
        plumber = require('gulp-plumber'),
        uglify = require('gulp-uglify');
  
    return gulp.src(paths.srcScriptsPlugins.concat(paths.srcScriptsFile))
      .pipe(plumber({
        errorHandler: function (e) {
            console.log(e.toString());
            this.emit('end');
        }
      }))
    //    .pipe(uglify())
    .pipe(concat('main.js'))
    .pipe(gulp.dest(paths.distScriptsDir));
  
  });
  
  // default task
  gulp.task('default', [
   'typescript',
    'scripts'
   ]);
  </code></pre>