-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.js
34 lines (29 loc) · 1.2 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
const gulp = require("gulp");
const sourcemaps = require("gulp-sourcemaps");
const tsProject = require("gulp-typescript").createProject("tsconfig.json");
const vfs = require("vinyl-fs");
const paths = {
tocopy: ["./**", "!./.git", "!./.git/**", "!./bin", "!./bin/**", "!./**/*.ts", "!./.vscode", "!./.vscode/**", "!./gulpfile.js", "!./*.log", "!./*.lock", "!./*.md",
"!./*.json", "!./.editorconfig", "!./.gitignore", "!./.jshintrc", "!./.istanbul.yml", "!./LICENSE", "!./test/unit/*.ts", "!./test/mocha.opts",
"!./coverage", "!./coverage/**", "!./.dockerignore", "!./docker-compose.yml", "!./Dockerfile", "!./node_modules", "!./node_modules/**",
"!./Makefile"
],
tsfiles: ["./**, ./config", "./lib", "./test"]
};
gulp.task("copy", () => {
return vfs.src(paths.tocopy, {
dot: true
})
.pipe(vfs.dest("./bin"));
});
gulp.task("transpile", () => {
return tsProject.src()
.pipe(sourcemaps.init())
.pipe(tsProject()).js
.pipe(sourcemaps.write("./maps"))
.pipe(gulp.dest("./bin"));
});
gulp.task("default", ["copy", "transpile"], (done) => done());
gulp.task("watch", () => {
gulp.watch(paths.tsfiles, ["transpile"]);
});