-
Notifications
You must be signed in to change notification settings - Fork 99
/
Copy pathgulpfile.js
54 lines (46 loc) · 1.43 KB
/
gulpfile.js
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
50
51
52
53
54
var gulp = require('gulp'),
webserver = require('gulp-webserver'),
typescript = require('gulp-typescript'),
sourcemaps = require('gulp-sourcemaps'),
tscConfig = require('./tsconfig.json');
var appSrc = 'builds/development/',
tsSrc = 'process/typescript/';
gulp.task('html', function() {
gulp.src(appSrc + '**/*.html');
});
gulp.task('css', function() {
gulp.src(appSrc + '**/*.css');
});
gulp.task('copylibs', function() {
return gulp
.src([
'node_modules/es6-shim/es6-shim.min.js',
'node_modules/systemjs/dist/system-polyfills.js',
'node_modules/angular2/bundles/angular2-polyfills.js',
'node_modules/systemjs/dist/system.src.js',
'node_modules/rxjs/bundles/Rx.js',
'node_modules/angular2/bundles/angular2.dev.js'
])
.pipe(gulp.dest(appSrc + 'js/lib/angular2'));
});
gulp.task('typescript', function () {
return gulp
.src(tsSrc + '**/*.ts')
.pipe(sourcemaps.init())
.pipe(typescript(tscConfig.compilerOptions))
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(appSrc + 'js/'));
});
gulp.task('watch', function() {
gulp.watch(tsSrc + '**/*.ts', ['typescript']);
gulp.watch(appSrc + 'css/*.css', ['css']);
gulp.watch(appSrc + '**/*.html', ['html']);
});
gulp.task('webserver', function() {
gulp.src(appSrc)
.pipe(webserver({
livereload: true,
open: true
}));
});
gulp.task('default', ['copylibs', 'typescript', 'watch', 'webserver']);