-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
46 lines (39 loc) · 1.16 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
// --------------------------------------------------
// IMPORT MODULES
// --------------------------------------------------
// Node
// Vendor
const gulp = require( 'gulp' );
const ts = require( 'gulp-typescript' );
const tsLint = require( 'gulp-tslint' );
// --------------------------------------------------
// DECLARE VARS
// --------------------------------------------------
const tsProject = ts.createProject( 'tsconfig.json' );
// --------------------------------------------------
// DEFINE TASKS
// --------------------------------------------------
/**
* Wrapper around any/all tasks to be executed when `gulp` is run.
*/
gulp.task( 'default', [ 'ts' ], function() {
console.log( 'INSIDE TASK: `default`' );
} );
/**
* Wrapper around any/all TypeScript-related tasks.
*/
gulp.task( 'ts', [ 'ts:lint', 'ts:transpile' ] );
gulp.task( 'ts:lint', function() {
return gulp.src( 'src/**/*.ts' )
.pipe( tsLint( {
configuration: 'tslint.json',
} ) )
.pipe( tsLint.report( {
summarizeFailureOutput: true,
} ) );
} );
gulp.task( 'ts:transpile', function() {
let result = tsProject.src()
.pipe( tsProject() );
result.js.pipe( gulp.dest( './dist' ) );
} );