-
Notifications
You must be signed in to change notification settings - Fork 0
/
Gulpfile.ts
56 lines (46 loc) · 1.38 KB
/
Gulpfile.ts
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
49
50
51
52
53
54
55
56
import * as del from 'del';
import * as fs from 'fs';
import * as gulp from 'gulp';
import * as coveralls from 'gulp-coveralls';
import * as nodemon from 'gulp-nodemon';
import tslint from 'gulp-tslint';
import * as runSequence from 'run-sequence';
import { distDir } from './tasks/util';
import registerModules from './tasks';
registerModules(gulp);
gulp.task('default', ['build'], (cb) => {
runSequence('watch', 'start', cb);
});
gulp.task('build', ['clean'], (cb) => {
runSequence('common:copy', 'server:build', 'client:build', cb);
});
gulp.task('start', () => {
// Read from standard config so devs can also run `nodemon` from the console
// and have it work the same way as it does here
const config = JSON.parse(fs.readFileSync('nodemon.json', 'utf8'));
nodemon(config);
});
gulp.task('testPrep', ['build'], (cb) => {
runSequence('server:testPrep', cb);
});
gulp.task('coveralls', () => {
return gulp.src('coverage/lcov.info').pipe(coveralls());
});
gulp.task('lint', () => {
return gulp.src(['server/**/*.ts', 'client/app/**/*.ts'])
.pipe(tslint({
configuration: 'tslint.json',
formatter: 'prose'
}))
.pipe(tslint.report());
});
gulp.task('watch', [
'client:watch',
'common:watch',
'server:watch'
]);
gulp.task('clean', ['client:clean', 'server:clean'], () =>
del([
distDir()
])
);