-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
55 lines (49 loc) · 1.28 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
54
55
var browserify = require("browserify");
var source = require("vinyl-source-stream");
var buffer = require("vinyl-buffer");
var gulp = require("gulp");
var uglify = require("gulp-uglify");
var tslint = require("gulp-tslint");
var tsc = require("gulp-typescript");
var open = require("gulp-open");
var del = require("del");
var project = tsc.createProject("tsconfig.json");
/*
Remove all files from the build directory before building
a new release of the server.
*/
gulp.task("clean", function() {
return del(["build/**/**.*", "build/**"], {force: true});
});
/*
Compile the TypeScript source into JavaScript and place
the new files in the build directory.
*/
gulp.task("build", [/*"clean"*/], function() {
var build = gulp.src([
"app/types/types.d.ts",
"app/**/**.ts"
])
.pipe(project())
.js.pipe(gulp.dest("build/"));
return build;
});
/*
Lint the source TypeScript files using the tslist.json
file at the project root.
*/
gulp.task("lint", function() {
return gulp.src([
"app/**/**.ts"
])
.pipe(tslint({}))
.pipe(tslint.report("verbose"));
});
/*
Open the built website using the operating system's
default browser.
*/
gulp.task("open", function(){
gulp.src(__filename)
.pipe(open({uri: "http://localhost:3002"}));
});