-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathgulpfile.js
More file actions
46 lines (39 loc) · 1.28 KB
/
gulpfile.js
File metadata and controls
46 lines (39 loc) · 1.28 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
var gulp = require('gulp'),
typescript = require('gulp-typescript'),
sourcemaps = require('gulp-sourcemaps'),
tscConfig = require('./tsconfig.json');
var appSrc = 'public/',
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/es6-shim/es6-shim.min.map',
'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('default', ['copylibs', 'typescript', 'watch']);