-
Notifications
You must be signed in to change notification settings - Fork 0
/
gulpfile.ts
44 lines (35 loc) · 964 Bytes
/
gulpfile.ts
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
import {Gulpclass, Task, SequenceTask, MergedTask} from 'gulpclass'
import Gulp from 'gulp'
import Shell from 'gulp-shell'
import TS from 'gulp-typescript'
const Del = require('del')
@Gulpclass()
export class Gulpfile {
@Task()
clean(cb: Function) {
return Del(['./dist/**'], cb)
}
@MergedTask()
compile() {
const proj = TS.createProject("tsconfig.json", { typescript: require("typescript") })
const tsResult = Gulp.src(["./*.ts", "./node_modules/@types/**/*.ts", "!gulpfile.ts"])
.pipe(proj())
return [
tsResult.dts.pipe(Gulp.dest("./dist")),
tsResult.js.pipe(Gulp.dest("./dist"))
];
}
@Task()
copyPackageFile() {
return Gulp.src("./package.json")
.pipe(Gulp.dest("./dist"));
}
@SequenceTask()
package() {
return [
"clean",
"compile",
"copyPackageFile"
]
}
}