-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathgulpfile.js
71 lines (60 loc) · 1.66 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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
import gulp from "gulp";
import * as css from "./utils/css.mjs";
import * as javascript from "./utils/javascript.mjs";
import * as packs from "./utils/packs.mjs";
import * as staticGulp from "./utils/static.mjs";
import {deleteAsync} from "del";
import {existsSync} from "fs";
import {mkdir} from "fs/promises"
function cleanDist() {
return deleteAsync(["dist/**", "!dist/.gitkeep"], {force: true});
}
async function ensureDist() {
if (!existsSync("dist")) return mkdir("dist");
else return Promise.resolve();
}
// Clean
export const clean = gulp.series(cleanDist, ensureDist);
// Javascript compiling & linting
export const buildJS = gulp.series(javascript.compile);
export const lint = gulp.series(javascript.lint);
// CSS compiling
export const buildCSS = gulp.series(css.compile);
// Compendium pack management
export const cleanPacks = gulp.series(packs.clean);
export const compilePacks = gulp.series(packs.compile);
export const extractPacks = gulp.series(packs.extract);
// Static copy
export const copyStatic = gulp.parallel(
staticGulp.copyBabele,
staticGulp.copyFonts,
staticGulp.copyIcons,
staticGulp.copyJson,
staticGulp.copyLang,
staticGulp.copyPacks,
staticGulp.copyTemplates,
staticGulp.copyUi,
staticGulp.copyStaticRoot,
staticGulp.copyRoot
);
// Build all artifacts
export const buildAll = gulp.series(
clean,
gulp.parallel(
css.compile,
javascript.compile,
packs.compile,
copyStatic
)
);
// Watch for updates
export const watchUpdates = gulp.series(
buildAll,
gulp.parallel(
css.watchUpdates,
javascript.watchUpdates,
staticGulp.watchUpdates
)
);
// Default export - watch
export default watchUpdates;