forked from Scott-Lyons/TypeScriptKaizen
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
32 lines (25 loc) · 776 Bytes
/
gulpfile.js
File metadata and controls
32 lines (25 loc) · 776 Bytes
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
var gulp = require('gulp');
var uglify = require('gulp-uglify');
var ts = require('gulp-typescript');
var runSequence = require('run-sequence');
gulp.task('compress', function() {
return gulp.src('app/**/*.js')
.pipe(uglify())
.pipe(gulp.dest('build'));
});
var tsProject = ts.createProject('tsconfig.json');
gulp.task('tsc', function () {
var tsResult = tsProject.src()
.pipe(ts(tsProject));
return tsResult.js.pipe(gulp.dest('build'));
});
gulp.task('tscw', function () {
gulp.watch('app/**/*.ts', ["tsc"]);
});
gulp.task('develop', function () {
gulp.watch('app/**/*.ts', ["tscw"]);
gulp.watch('app/**/*.js', ["compress"]);
});
gulp.task('bundle_and_minify', function(callback) {
runSequence('tsc','compress', callback);
});