forked from balena-io-modules/balena-procbots
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
41 lines (35 loc) · 1.02 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
const gulp = require('gulp');
const gutil = require('gulp-util');
const typescript = require('gulp-typescript');
const sourcemaps = require('gulp-sourcemaps');
const tslint = require('gulp-tslint');
const tsProject = typescript.createProject('tsconfig.json');
const OPTIONS = {
files: {
declarations: [ 'lib/**/*.d.ts' ]
}
}
// Compile the TS sources
gulp.task('typescript', () => {
tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject()).on('error', gutil.log)
.pipe(sourcemaps.write('./', { includeContent: true,
sourceRoot: '../lib'
}))
.pipe(gulp.dest('build/'));
});
// Copy any pre-defined declarations
gulp.task('copydecs', () => {
gulp.src(OPTIONS.files.declarations)
.pipe(gulp.dest('build/'));
});
gulp.task('tslint', () =>
tsProject.src()
.pipe(tslint({
configuration: 'tslint.json',
formatter: 'prose'
}))
.pipe(tslint.report())
);
gulp.task('build', [ 'typescript', 'copydecs' ]);