-
Notifications
You must be signed in to change notification settings - Fork 1
/
gulpfile.js
36 lines (31 loc) · 928 Bytes
/
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
const gulp = require('gulp');
const ts = require("gulp-typescript");
const uglify = require('gulp-uglify');
const sourcemaps = require('gulp-sourcemaps');
const paths = {
pages: ['pages/*.html']
};
/* Functions in pipeline */
function copyHtml() {
return gulp.src(paths.pages)
.pipe(gulp.dest('dist'));
}
function buildTs() {
var tsProject = ts.createProject("src/tsconfig.json");
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("dist"))
.pipe(uglify())
.pipe(gulp.dest("dist"));
}
function buildTestTs() {
var tsProject = ts.createProject("test/src/tsconfig.json");
return tsProject.src()
.pipe(tsProject())
.js.pipe(gulp.dest("test/dist"))
};
/* Tasks */
gulp.task('copyHtml', copyHtml);
gulp.task('build', buildTs);
gulp.task('test', gulp.series(buildTs, buildTestTs));
gulp.task('default', gulp.series(buildTs, buildTestTs));