vite-plugin-cross-origin-isolation
vite-plugin-cross-origin-isolation copied to clipboard
This can now be supported through the `server.headers` option
Unfortunately, there is zero doc about server.headers
on the official website. Interesting.
The issue is closed, but you can still find some useful info there:
https://github.com/vitejs/vite/issues/3909
server.headers
seems to be documented now.
https://vitejs.dev/config/#server-headers
Now we can write vite.config.ts
like the bellow.
import { defineConfig } from "vite";
export default defineConfig({
server: {
headers: {
"Cross-Origin-Embedder-Policy": "require-corp",
"Cross-Origin-Opener-Policy": "same-origin",
},
},
});