-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
35 lines (26 loc) · 829 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
var gulp = require('gulp');
var gutil = require('gulp-util');
var ts = require('gulp-typescript');
var del = require('del');
var gulpCopy = require('gulp-copy');
gulp.task('default', ['build', 'copy-static'], function() {
gutil.log(gutil.colors.green('Your app should run from the ./output folder, like so:'));
gutil.log(' ', gutil.colors.bgGreen('node ./output/server.js'));
});
gulp.task('build', ['clean'], function() {
var tsProject = ts.createProject('tsconfig.json');
var tsResult = tsProject.src()
.pipe(ts(tsProject));
return tsResult.js.pipe(gulp.dest('output'));
});
gulp.task('clean', function(cb) {
del('output', cb);
})
gulp.task('copy-static', ['clean'], function() {
var source = [
'views/**/*',
'public/**/*'
]
return gulp.src(source)
.pipe(gulpCopy('output'));
});