This repository was archived by the owner on Mar 12, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
48 lines (42 loc) · 1.35 KB
/
index.ts
File metadata and controls
48 lines (42 loc) · 1.35 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
41
42
43
44
45
46
47
48
import SSSG, { Plugin } from "sssg";
import Dev from "./plugins/devPlugin";
import TSCompiler from "sssg/src/plugins/ts-compiler";
import Variables from "sssg/src/plugins/variables"
import * as path from "path";
import { $ } from "bun";
import { readFileSync } from "fs";
import Lucide from "./plugins/lucidePlugin";
const sssg = new SSSG({
outputFolder: path.join(__dirname, "dist"),
inputFolder: path.join(__dirname, "src"),
});
const plugins: Plugin[] = [];
if (process.argv.includes("--dev")) {
plugins.push(new Dev(sssg, {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp"
}));
} else {
if(process.argv.includes("--ci")) {
await $`mkdir -p audioengine2`
await $`wget https://files.sad.ovh/public/audioengine2.zip -O audioengine2.zip`
await $`unzip -o audioengine2.zip -d audioengine2`
await $`mv audioengine2/* src/`
await $`rm -r audioengine2.zip audioengine2`
}
}
const gitHash = await $`git rev-parse HEAD`.quiet().text();
await sssg.run({
plugins: plugins.concat([
new Variables(() => {
return {
"__TODO__": readFileSync("todo.md").toString(),
"__GIT_HASH__": gitHash.slice(0, 6),
"__LICENSES__": readFileSync("licenses").toString()
}
}),
new Lucide(),
new TSCompiler(!process.argv.includes("--dev")),
]),
});
await sssg.build();