meat/vite.config.ts
2026-08-05 09:24:13 +02:00

24 lines
623 B
TypeScript

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,
},
})