-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.ts
More file actions
40 lines (36 loc) · 1.15 KB
/
build.ts
File metadata and controls
40 lines (36 loc) · 1.15 KB
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
import createContentGraph from "./src/server/create-graph.ts";
import processWarnings from "./src/server/process-warnings.ts";
import checkCode from "./src/server/lint.ts";
const dataOnly = Bun.argv.includes("--data-only");
const bundleOnly = Bun.argv.includes("--bundle-only");
const buildGraph = Bun.argv.includes("graph");
const buildLint = Bun.argv.includes("lint");
const buildWarnings = Bun.argv.includes("warnings");
const buildWarningsFast = Bun.argv.includes("warnings-fast");
const buildExternalLinks = Bun.argv.includes("external-links");
if (!bundleOnly) {
if (buildGraph) {
await createContentGraph();
}
if (buildLint) {
await checkCode();
}
if (buildWarnings) {
await processWarnings();
} else if (buildWarningsFast) {
await processWarnings(true);
}
}
if (!dataOnly) {
await Bun.build({
entrypoints: [
buildGraph && "./src/client/index.ts",
(buildWarnings || buildWarningsFast) && "./src/client/warnings.ts",
buildExternalLinks && "./src/client/external-links.ts",
].filter(Boolean) as string[],
outdir: "./docs",
splitting: true,
});
}
// TODO: not sure why I need this
process.exit(0);