-
Notifications
You must be signed in to change notification settings - Fork 0
/
vite.config.ts
62 lines (61 loc) · 1.74 KB
/
vite.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import devtools from "solid-devtools/vite";
import vercel from "solid-start-vercel";
import solid from "solid-start/vite";
import UnoCSS from "unocss/vite";
import Icons from "unplugin-icons/vite";
import { defineConfig } from "vite";
import solidStyled from "vite-plugin-solid-styled";
export default defineConfig(() => {
return {
plugins: [
devtools({
autoname: true,
locator: {
targetIDE: "vscode",
},
}),
solid({
adapter: vercel(),
}),
Icons({ compiler: "solid" }),
UnoCSS(),
solidStyled({
prefix: "ss",
filter: {
include: "src/**/*.{ts,js,tsx,jsx}",
exclude: "node_modules/**/*.{ts,js,tsx,jsx}",
},
}),
{
name: "cross-origin-isolation",
configureServer: (server) => {
server.middlewares.use((_, response, next) => {
response.setHeader("Cross-Origin-Opener-Policy", "same-origin");
response.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
next();
});
},
configurePreviewServer: (server) => {
server.middlewares.use((_, response, next) => {
response.setHeader("Cross-Origin-Opener-Policy", "same-origin");
response.setHeader("Cross-Origin-Embedder-Policy", "require-corp");
next();
});
},
},
],
ssr: {
external: ["@prisma/client"],
noExternal: ["@kobalte/core", "crypto", "@internationalized/message"],
},
optimizeDeps: {
include: ["solid-devtools/setup"],
},
server: {
headers: {
"Cross-Origin-Opener-Policy": "same-origin",
"Cross-Origin-Embedder-Policy": "require-corp",
},
},
};
});