-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgulpfile.js
More file actions
63 lines (54 loc) · 1.57 KB
/
gulpfile.js
File metadata and controls
63 lines (54 loc) · 1.57 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
'use strict';
const gulp = require('gulp');
const gulpTs = require('gulp-typescript');
const gulpTslint = require('gulp-tslint');
const tslint = require('tslint');
const sourcemaps = require('gulp-sourcemaps');
const del = require('del');
const nodemon = require('gulp-nodemon');
const project = gulpTs.createProject('tsconfig.json');
const typeCheck = tslint.Linter.createProgram('tsconfig.json');
gulp.task('lint', () => {
return gulp.src('./src/**/*.ts')
.pipe(gulpTslint({
configuration: 'tslint.json',
formatter: 'prose',
program: typeCheck
}))
.pipe(gulpTslint.report());
});
gulp.task('build', ['lint'], () => {
// Delete the dist folder
del.sync(['./dist/**/*.*']);
return gulp.src('./src/**/*.ts')
.pipe(sourcemaps.init())
.pipe(project())
.pipe(sourcemaps.write('.', { includeContent: false, sourceRoot: '../src' }))
.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['build'], function () {
gulp.watch('./src/**/*.ts', ['build']);
});
gulp.task('start', ['build'], function () {
return nodemon({
script: './dist/bot.js',
watch: './dist/bot.js'
})
});
gulp.task('debug-prod', ['watch'], () => {
return nodemon({
script: './dist/bot.js',
watch: './dist/',
nodeArgs: ['--inspect']
})
});
gulp.task('debug', ['watch'], function () {
return nodemon({
script: './dist/bot.js',
watch: './dist/',
env: {
'NODE_ENV': 'development'
},
nodeArgs: ['--inspect'],
})
});