feat: threads
This commit is contained in:
parent
6fb46573da
commit
46e7070b6b
18 changed files with 878 additions and 125 deletions
|
|
@ -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,
|
||||
},
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue