-
Notifications
You must be signed in to change notification settings - Fork 18
/
gulpfile.js
executable file
·71 lines (63 loc) · 1.47 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
const gulp = require("gulp");
const requireDir = require("require-dir");
requireDir("./gulp");
// Copy ./src directory and build scripts into ./package
gulp.task(
"build:package", gulp.series(
"build:clean",
"build:copy-files",
"build:javascript",
"build:javascript-with-jquery",
"build:compress-images",
)
);
// Build the dist bundle of the package
gulp.task(
"build:dist", gulp.series(
"dist:clean",
"dist:javascript",
"dist:css",
"dist:assets",
"dist:zip",
)
);
// Initial build of the docs site to ./public
gulp.task(
"build:docs", gulp.series(
"docs:copy-files",
"build:package",
gulp.parallel("docs:styles", "docs:scripts"),
)
);
// Watch the docs site sass and all component sass files and recompile
gulp.task(
"watch:styles", () => {
gulp.watch(
["docs/assets/**/*.scss", "src/moj/components/**/*.scss"],
gulp.series(["docs:styles"]),
)
}
);
// Watch all the component js files and build the package
gulp.task(
"watch:package-js", () => {
gulp.watch(
["src/moj/components/**/*.js"],
gulp.series("build:javascript")
)
}
);
// Watch the docs js files and the bundled package js and rebuild
gulp.task(
"watch:docs-js", () => {
gulp.watch(
["docs/assets/**/*.js", "package/moj/all.js"],
gulp.series(["docs:scripts"]),
)
}
);
// Watch all the files in dev
gulp.task(
"watch:dev",
gulp.parallel("watch:styles", "watch:package-js", "watch:docs-js"),
);