mirror of
https://github.com/anomalyco/hex.git
synced 2026-11-22 21:23:02 +01:00
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.
13 lines
772 B
TypeScript
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 },
|
|
}))
|