-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
44 lines (37 loc) · 1021 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
var gulp = require('gulp');
var typescript = require('gulp-typescript');
var browserSync = require('browser-sync').create();
var del = require('del');
var config = require('./tsconfig.json');
gulp.task('clean:dist', function(){
return del.sync(['dist/*']);
});
gulp.task('compile:ts', function(){
return gulp.src(['src/ts/*.ts'])
.pipe(typescript(config.compilerOptions))
.js
.pipe(gulp.dest('dist/js/'));
});
gulp.task('copy:bower', function(){
return gulp.src(['src/js/bower_components/**'], { base: 'src/js' })
.pipe(gulp.dest('dist/js/'));
});
gulp.task('copy:html', function(){
return gulp.src(['src/*.html'])
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', function(){
gulp.watch([
'src/ts/*.ts',
'src/*.html'
], ['compile:ts','copy:html']);
});
gulp.task('server', function(){
browserSync.init({
server: {
baseDir: 'dist'
},
files: ['dist/*']
});
});
gulp.task('default',['clean:dist','compile:ts','copy:html','copy:bower','server','watch']);