hex/site/vite.config.ts
Luke Parker 864302b788
site: bench with @hona/strobe 0.2: canvas frames, GPU compiles, hidden source maps (#1218)
Import the bench SDK from @hona/strobe (the old @hona/strobe-bench name is deprecated). The idle head reports canvas.frames and canvas.interval.p95, the show's own WebGPU frames at its own rate, and the load case gpu.compile. Vite emits hidden source maps when strobe builds (STROBE_SOURCEMAP=hidden), so profiles name source lines; deploy builds are unchanged. Docs: any commit works as --base now (strobe overlays head's harness), report --format pr for PR tables, and large seeds are shared read only.
2026-11-03 18:20:34 -06:00

13 lines
772 B
TypeScript

import { cloudflare } from "@cloudflare/vite-plugin"
import react from "@vitejs/plugin-react"
import { defineConfig } from "vite"
import { BASE_PATH } from "./src/base.ts"
// The Cloudflare plugin only shapes the client build into Build Output for `cf deploy`.
// Dev stays plain Vite, and the SSR build only feeds the prerender.
export default defineConfig(({ command, isSsrBuild }) => ({
plugins: [react(), ...(command === "build" && !isSsrBuild ? [cloudflare()] : [])],
base: `${BASE_PATH}/`,
// strobe builds with STROBE_SOURCEMAP=hidden: maps beside the scripts for its profiles, the scripts unchanged.
build: { sourcemap: (globalThis as { process?: { env: Record<string, string | undefined> } }).process?.env.STROBE_SOURCEMAP as "hidden" | undefined },
}))