-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgulpfile.js
46 lines (41 loc) · 973 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
37
38
39
40
41
42
43
44
45
46
const { dest, series, src, watch } = require('gulp');
const clean = require('gulp-clean');
const rename = require('gulp-rename');
const ts = require('gulp-typescript');
const uglify = require('gulp-uglify');
function buildClean(cb) {
return src('dist').pipe(clean({ force: true }));
}
function build() {
return src('src/*.ts')
.pipe(
ts({
noImplicitAny: true,
})
)
.pipe(dest('dist'));
}
function buildMinify() {
return src('src/*.ts')
.pipe(
ts({
noImplicitAny: true,
})
)
.pipe(
uglify({
output: {
comments: 'some',
},
})
)
.pipe(rename({ suffix: '.min' }))
.pipe(dest('dist'));
}
function copyForDemo() {
return src('dist/kaleidoscope.min.js').pipe(dest('docs'));
}
exports.watch = function() {
watch('src/*.ts', series(buildClean, build, buildMinify, copyForDemo));
};
exports.default = series(buildClean, build, buildMinify, copyForDemo);