forked from PradeepJaiswar/express-microservice-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
39 lines (32 loc) · 912 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
36
37
38
39
'use strict';
const gulp = require('gulp');
const ts = require('gulp-typescript');
const tslint = require('gulp-tslint');
const del = require('del');
const SRC_TS = 'src/**/*.ts';
const tsProject = ts.createProject('tsconfig.json');
// task to clean all files in build folder
gulp.task('clean:build', () => {
return del(['build/**/*']);
});
gulp.task('tslint', () => {
return gulp.src(SRC_TS)
.pipe(tslint({
formatter: 'verbose'
}))
.pipe(tslint.report())
});
// task to transpile all typescripts into javascript in build folder
gulp.task('build', () => {
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest('build'));
});
// tasks to watch over changes
gulp.task('watch', () => {
gulp.watch(SRC_TS, gulp.series('tslint', 'build'));
});
// default tasks
gulp.task('default', gulp.series('clean:build', 'build', 'watch'), () => {
console.log('Project successfully build');
});