concept-collection / matmul-bench
matmul-bench / vite.config.ts
19 lines · 654 BBlameHistoryRaw
1import { defineConfig } from 'vite'
2import react from '@vitejs/plugin-react'
4// Cross-origin isolation headers so SharedArrayBuffer (WASM threads, used by
5// the threaded BLIS method) is available during local dev/preview. In
6// production on GitHub Pages these can't be set as headers, so the app also
7// ships public/coi-serviceworker.js (registered from index.html).
8const coopCoep = {
9 'Cross-Origin-Opener-Policy': 'same-origin',
10 'Cross-Origin-Embedder-Policy': 'require-corp',
13// https://vite.dev/config/
14export default defineConfig({
15 plugins: [react()],
16 base: './',
17 server: { headers: coopCoep },
18 preview: { headers: coopCoep },
19})