-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgulpfile.js
More file actions
36 lines (30 loc) · 880 Bytes
/
gulpfile.js
File metadata and controls
36 lines (30 loc) · 880 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
33
34
35
var gulp = require('gulp'),
ts = require('gulp-typescript'),
exec = require('child_process').exec,
nodemon = require('gulp-nodemon');
gulp.task('default', ['frontend', 'backend', 'watch', 'nodemon']);
gulp.task('backend', function () {
return gulp.src('./server/**/*.ts')
.pipe(ts({
noImplicitAny: true,
lib: ["es2015"]
}))
.pipe(gulp.dest('dist/'));
});
gulp.task('watch', ['backend'], function () {
gulp.watch('./server/**/*.ts', ['backend']);
});
gulp.task('frontend', function (cb) {
exec('ng build --prod -op=dist/public', function (err, stdout, stderr) {
console.log(stdout);
console.log(stderr);
cb(err);
});
})
gulp.task('nodemon', function() {
nodemon({
script: 'dist/server.js',
ext: 'js',
env: { 'NODE_ENV': 'development' }
})
});