-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathgulpfile.js
36 lines (30 loc) · 895 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
/**
* Gulpfile.js
*/
const { src, parallel, dest, watch } = require("gulp");
const terser = require("gulp-terser");
const rename = require("gulp-rename");
const less = require("gulp-less");
const cleanCSS = require("gulp-clean-css");
function terserDocConfigJS() {
return src("./docs/pre.config.js")
.pipe(terser())
.pipe(rename("pre.config.min.js"))
.pipe(dest("./docs/dist"));
}
function compileDocLess() {
return src("./docs/index.less")
.pipe(less())
.pipe(cleanCSS())
.pipe(rename("index.min.css"))
.pipe(dest("./docs/dist"));
}
function watchDocConfig() {
watch("./docs/pre.config.js", terserDocConfigJS);
watch("./docs/styles/*.less", compileDocLess);
}
exports.build = parallel(terserDocConfigJS, compileDocLess);
exports.watch = watchDocConfig;
exports.js = terserDocConfigJS;
exports.less = compileDocLess;
exports.default = watchDocConfig;