-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
50 lines (43 loc) · 1.15 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
const gulp = require('gulp')
const clean = require('gulp-clean')
const ts = require('gulp-typescript')
const tsProject = ts.createProject('tsconfig.json')
const mocha = require('gulp-mocha')
const eslint = require('gulp-eslint')
gulp.task('lint', () => gulp
.src(['src/**/*.ts', 'test/**/*.ts'])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError())
)
gulp.task('clean', () => gulp
.src('dist', { read: true, allowEmpty: true })
.pipe(clean('dist'))
)
gulp.task('build', () => tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest('dist'))
)
gulp.task('types', () => tsProject.src()
.pipe(tsProject())
.dts.pipe(gulp.dest('dist'))
)
gulp.task('test', () => gulp.src(['test/*.ts'], { read: false })
.pipe(mocha({
reporter: 'spec',
require: ['ts-node/register']
}))
)
gulp.task('default', gulp.series(
gulp.parallel('lint'),
gulp.parallel('clean'),
gulp.parallel('build'),
gulp.parallel('types'),
gulp.parallel('test'))
)
gulp.task('build-only', gulp.series(
gulp.parallel('lint'),
gulp.parallel('clean'),
gulp.parallel('build'),
gulp.parallel('types'))
)