-
Notifications
You must be signed in to change notification settings - Fork 3
/
gulpfile.js
45 lines (41 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 ts = require('gulp-typescript');
var uglify = require('gulp-uglify');
var rename = require('gulp-rename');
var mocha = require('gulp-mocha');
var clean = require('gulp-clean');
gulp.task('product', function () {
var tsProject = ts.createProject('tsconfig1.json');
// compile to single file.
gulp.src([
"control/*.ts",
"core/*.ts",
"model/*.ts",
"utils/*.ts",
]).pipe(tsProject(ts.reporter.nullReporter()))
.pipe(gulp.dest("build"))
.pipe(uglify({ mangle: false }))
.pipe(rename("tinyts.min.js"))
.pipe(gulp.dest("build"));
});
gulp.task('test_compile', function () {
// compile to files
gulp.src([
"**/*.ts",
"!application/*.ts"
]).pipe(ts({
emitDecoratorMetadata: true,
experimentalDecorators: true,
moduleResolution: "classic",
target: "es5",
module: "commonjs"
}, ts.reporter.nullReporter())).pipe(gulp.dest("dist"));
});
gulp.task('clean', function () {
gulp.src('dist', { read: false })
.pipe(clean());
})
gulp.task('default', ['clean'], function () {
gulp.start("test_compile");
gulp.start("product");
});