forked from ElChitarrino/github-seed
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
45 lines (38 loc) · 1.19 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
var gulp = require('gulp');
var tslint = require('gulp-tslint');
var tsc = require('gulp-typescript');
var clean = require('gulp-clean');
var karma = require('karma').Server;
var join = require('path').join;
gulp.task('tslint', function(){
return gulp.src('src/**/*.ts')
.pipe(tslint())
.pipe(tslint.report('verbose'));
});
gulp.task('compile', function(){
// sourceRoot is not supported in this gulp tasks
// apart from that this should resemble tsconfig.json
var tscOptions = {
"target": "ES5",
"module": "commonjs",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"removeComments": false,
"noImplicitAny": false,
"suppressImplicitAnyIndexErrors": true,
"rootDir": "./src",
"outDir": "./dist",
"moduleResolution": "node"
};
gulp.src('./dist')
.pipe(clean());
var tsResult = gulp.src(['./typings/tsd.d.ts','./src/**/*.ts'])
.pipe(tsc(tscOptions));
return tsResult.js.pipe(gulp.dest('./dist'));
});
gulp.task('test', function (done) {
karma.start({
configFile: join(process.cwd(), 'karma.conf.js'),
singleRun: true
}, done);
});