feat: threads

This commit is contained in:
Dan Finch 2026-08-05 09:24:13 +02:00
parent 6fb46573da
commit 46e7070b6b
18 changed files with 878 additions and 125 deletions

View file

@ -1,8 +1,24 @@
import { defineConfig } from "vite"
// Cross-origin isolation (COOP + COEP) is required for SharedArrayBuffer, which
// the multi-threaded renderer uses to share the framebuffer across workers.
// Without these headers the app still runs -- it falls back to single-threaded.
const crossOriginIsolation = {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
}
export default defineConfig({
resolve: {
tsconfigPaths: true,
},
worker: {
format: "es",
},
server: {
headers: crossOriginIsolation,
},
preview: {
headers: crossOriginIsolation,
},
})