-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgulpfile.js
53 lines (48 loc) · 1.44 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
47
48
49
50
51
52
53
/*
This file in the main entry point for defining Gulp tasks and using Gulp plugins.
Click here to learn more. http://go.microsoft.com/fwlink/?LinkId=518007
*/
var gulp = require('gulp'),
tsc = require("gulp-typescript"),
del = require("del"),
jas = require("gulp-jasmine"),
watch = require('gulp-watch'),
flatten = require('gulp-flatten'),
uglify = require('gulp-uglify'),
rename = require('gulp-rename'),
tsd = require('gulp-tsd');
var paths = {
output: "./dist/",
typeScript: './src/**/*.ts',
tests: './tests/*.ts'
};
gulp.task('typeScript', function () {
var out = gulp.src([paths.typeScript])
.pipe(tsc({ declaration: true, removeComments : false}));
out.dts.pipe(gulp.dest(paths.output));
out.js.pipe(gulp.dest(paths.output))
.pipe(rename({ extname: ".min.js" }))
.pipe(uglify())
.pipe(gulp.dest(paths.output));
});
gulp.task('declaration', function (callback) {
tsd({
command: 'reinstall',
config: './tsd.json'
}, callback);
})
gulp.task('test', function () {
gulp.src([paths.tests])
.pipe(tsc({out: "test.js"}).js)
.pipe(flatten())
.pipe(gulp.dest('./tests/output/script/'))
.pipe(jas());
});
gulp.task('clean', function () {
del([paths.css, paths.lib])
});
gulp.task('watch', function () {
gulp.watch(paths.typeScript, ['typeScript', 'test'])
gulp.watch(paths.tests, ['test'])
gulp.watch(paths.allSass, ['sass'])
});