forked from TheFearlessAntelopes/crypto-trade
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
49 lines (39 loc) · 1.43 KB
/
gulpfile.js
File metadata and controls
49 lines (39 loc) · 1.43 KB
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
45
46
47
48
const gulp = require('gulp');
const del = require('del');
// const clean = require('gulp-clean');
const shell = require('gulp-shell');
// const sync = require('gulp-sync')(gulp);
// const nodemon = require('gulp-nodemon');
const ts = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
// gulp.task('clean', function () {
// return gulp
// .src('dist', { read: false })
// .pipe(clean());
// });
gulp.task('clean', () => {
del('server');
return del('dist');
});
gulp.task('serverCompile', () => {
return gulp.src('src-server/**/*.ts')
.pipe(sourcemaps.init())
.pipe(ts({
noImplicitAny: true,
}))
.pipe(sourcemaps.write())
.pipe(gulp.dest('server'));
})
gulp.task('copyServerJs', function () {
return gulp.src('src-server/**/*.js')
.pipe(gulp.dest('server'));
});
gulp.task('build', shell.task(['ng build']));
gulp.task('buildWatch', shell.task(['ng build --watch']));
gulp.task('runServerOnce', shell.task(['node server/app.js']));
gulp.task('runServer', shell.task(['nodemon server/app.js']));
// gulp.task('default', ['clean', 'buildWatch', 'server']);
gulp.task('run', gulp.parallel('buildWatch', 'runServer'));
gulp.task('runOnce', gulp.parallel('build', 'runServerOnce'));
gulp.task('default', gulp.series('clean', 'serverCompile', 'copyServerJs', 'run'));
gulp.task('serveOnce', gulp.series('clean', 'serverCompile', 'copyServerJs', 'runOnce'));