-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
35 lines (27 loc) · 934 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
const gulp = require('gulp');
const gulpTs = require('gulp-typescript');
const tslint = require("tslint");
const gulpTslint = require("gulp-tslint");
const JSON_FILES = ['src/*.json', 'src/**/*.json'];
const project = gulpTs.createProject('tsconfig.json');
const linterProject = gulpTs.createProject('tsconfig.json');
gulp.task('scripts', () => {
const result = project.src()
.pipe(project());
return result.js.pipe(gulp.dest('dist'));
});
gulp.task('watch', ['scripts'], () => {
gulp.watch('src/**/*.ts', ['scripts']);
});
gulp.task('assets', () => {
return gulp.src(JSON_FILES)
.pipe(gulp.dest('dist'));
});
gulp.task('lint', () => {
const program = tslint.Linter.createProgram('./tsconfig.json', '.');
linterProject.src()
.pipe(gulpTslint({ program }))
.pipe(gulpTslint.report())
.pipe(linterProject());
});
gulp.task('default', ['watch', 'assets', 'lint']);