-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathvite.config.ts
More file actions
33 lines (30 loc) · 1.44 KB
/
Copy pathvite.config.ts
File metadata and controls
33 lines (30 loc) · 1.44 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
import { defineConfig, type Plugin } from "vite";
import { copyFileSync, cpSync, mkdirSync } from "node:fs";
import { dirname, resolve } from "node:path";
import { fileURLToPath } from "node:url";
const here = dirname(fileURLToPath(import.meta.url));
// SB-44-05: publish the gate-verification deck (the hosted protocol + report
// surface with rig triggers, SB-44-01..03) alongside the app at /playtest/, so
// it is served same-origin with the game. Same origin = the deck's deep-links
// reach the rig loader and its verdict store is the one the in-game HUD writes,
// unifying both capture surfaces into one report. The deck stays sourced in
// pm/ (single source of truth); this copies it into the build output.
function publishPlaytestDeck(): Plugin {
const deckDir = resolve(here, "pm/roadmap/serfbound/phase-44-gate-verification/playtest");
return {
name: "serfbound-publish-playtest-deck",
apply: "build",
closeBundle() {
const destDir = resolve(here, "dist/playtest");
mkdirSync(destDir, { recursive: true });
copyFileSync(resolve(deckDir, "index.html"), resolve(destDir, "index.html"));
// SB-44-09: the deck wears the shell's gumps too — ship its material
// chrome alongside it so the protocol reads as part of the game.
cpSync(resolve(deckDir, "gumps"), resolve(destDir, "gumps"), { recursive: true });
},
};
}
export default defineConfig({
base: "./",
plugins: [publishPlaytestDeck()],
});