-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (43 loc) · 1.25 KB
/
gulpfile.js
File metadata and controls
49 lines (43 loc) · 1.25 KB
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var gulp = require('gulp');
var shell = require('gulp-shell');
var del = require('del');
var concat = require('gulp-concat');
var runSequence = require('run-sequence');
// static dependencies for Angular2
var deps = [
'node_modules/systemjs/node_modules/es6-module-loader/node_modules/traceur/bin/traceur.js',
'node_modules/systemjs/node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.js',
'node_modules/systemjs/dist/system.js',
'node_modules/zone.js/zone.js',
'node_modules/zone.js/long-stack-trace-zone.js',
'./traceurOptions.js'
];
// Angular2 AtScript to ES5
gulp.task('build:ng2', shell.task(['sh ng2build.sh']));
// strip off the sourceMaps.
gulp.task('build:strip_maps', shell.task(["sh strip_maps.sh"]));
// Concat all static dependencies for Angular2
gulp.task('build:shim', function() {
return gulp.src(deps)
.pipe(concat('es6-shim.js'))
.pipe(gulp.dest('./dist/'));
});
// Delete to start fresh
gulp.task('clean', function(cb) {
del([
'./angular2',
'./rtts_assert',
'./dist'
], cb);
});
// Synchronous build
// 1. clean
// 2. ng2build
// 3. concat es6 shim file
gulp.task('default', function(cb) {
runSequence('clean',
'build:ng2',
'build:shim',
'build:strip_maps',
cb);
});