-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
33 lines (28 loc) · 854 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
"use strict";
var gulp = require('gulp');
var jasmine = require('gulp-jasmine');
var ts = require('gulp-typescript');
gulp.task('ts_test', function () {
var tsProject = ts.createProject('tsconfig.json', {
noImplicitAny: true,
out: 'test.js'
});
var tsResult = gulp.src('src/**/*.ts').pipe(ts(tsProject)); // also include spec files
return tsResult.js.pipe(gulp.dest('built/local'));
});
gulp.task('ts', function () {
var tsProject = ts.createProject('tsconfig.json', {
noImplicitAny: true,
out: 'dist.js'
});
var tsResult = tsProject.src().pipe(ts(tsProject));
return tsResult.js.pipe(gulp.dest('built/local'));
});
// Test JS
gulp.task('test', ['ts_test'], function () {
return gulp.src('built/local/test.js').pipe(jasmine({
includeStackTrace: true
}));
});
gulp.task('default', ['test']);
gulp.task('build', ['ts']);