Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This can now be supported through the server.headers option #3

Open
chaosprint opened this issue Apr 13, 2022 · 1 comment
Open

This can now be supported through the server.headers option #3

chaosprint opened this issue Apr 13, 2022 · 1 comment

Comments

@chaosprint
Copy link
Owner

chaosprint commented Apr 13, 2022

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:
vitejs/vite#3909

@chaosprint chaosprint changed the title Read before use This can now be supported through the server.headers option Apr 13, 2022
@reosablo
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants