-
Notifications
You must be signed in to change notification settings - Fork 2
/
gulpfile.js
49 lines (42 loc) · 1017 Bytes
/
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
var gulp = require('gulp'),
ts = require('gulp-typescript'),
del = require('del'),
connect = require('gulp-connect');
var paths = {
ts: [
'app/**/*.ts',
'_definitions/**/**.d.ts',
'bower_components/phaser/typescript/phaser.d.ts',
'bower_components/phaser/typescript/pixi.d.ts'
],
assets: [
'app/**/*',
'!app/**/*.ts',
'bower_components/**/*'
]
};
gulp.task('clean', function(cb) {
del(['build'], {force: true}, cb);
});
gulp.task('assets', ['clean'], function() {
return gulp.src(paths.assets, {base: '.'})
.pipe(gulp.dest('build'));
});
gulp.task('compile', ['assets'], function() {
return gulp.src(paths.ts)
.pipe(ts({
noExternalResolve: true,
module: 'amd'
}))
.js.pipe(gulp.dest('build/app'))
.pipe(connect.reload());
});
gulp.task('connect', function() {
connect.server({
root: 'build',
livereload: true
})
});
gulp.task('default', ['connect', 'compile'], function() {
gulp.watch(['app/**/*'], ['compile']);
});