aboutsummaryrefslogtreecommitdiff
path: root/tools/tasks/build.bundles.ts
blob: 52eb381ecb5abd822560f0f763d35880ca43726d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import {parallel} from 'async';
import {join} from 'path';
import * as Builder from 'systemjs-builder';
import {BUNDLES_DEST, SYSTEM_CONFIG_BUILDER} from '../config';

const BUNDLE_OPTS = {
  minify: true,
  sourceMaps: true,
  format: 'cjs'
};

export = function bundles(gulp, plugins) {
  return function (done) {
    let builder = new Builder(SYSTEM_CONFIG_BUILDER);

    parallel([
      bundleApp
    ], () => done());

    function bundleApp(done) {
      builder.bundle(
        'bootstrap - angular2/*',
        join(BUNDLES_DEST, 'app.js'), BUNDLE_OPTS).then(done);
    }
  };
};