-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
31 lines (25 loc) · 863 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
const gulp = require('gulp');
const ts = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const tsProject = ts.createProject('tsconfig.json');
gulp.task('build-api', () => {
const tsResult = tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject());
return tsResult.js
.pipe(sourcemaps.write())
.pipe(gulp.dest('release'));
});
gulp.task('build-client', () => {
return gulp.src('src/client/**/*.*')
.pipe(gulp.dest('release/client'));
});
gulp.task('compile', ['build-api', 'build-client']);
// Watch file changes and runs a task when this occurs.
gulp.task('watch', ['compile'], () => {
gulp.watch('src/**/*.ts', ['compile']);
});
gulp.task('watch-client', ['build-client'], () => {
gulp.watch('src/client/**/*', ['build-client']);
});
gulp.task('default', ['watch']);