forked from kojibai/PHI_NETWORK
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
50 lines (45 loc) · 1.11 KB
/
vite.config.ts
File metadata and controls
50 lines (45 loc) · 1.11 KB
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
// vite.config.ts
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import { BASE_APP_VERSION } from "./src/version";
export default defineConfig(({ isSsrBuild }) => {
const ssrBuild = isSsrBuild === true;
return {
plugins: [react()],
resolve: {
dedupe: [
"react",
"react-dom",
"react/jsx-runtime",
"react-router",
"react-router-dom",
],
},
server: {
proxy: {
"/api": "http://localhost:8787",
"/sigils": {
target: "https://m.kai.ac",
changeOrigin: true,
secure: true,
},
},
},
define: {
"import.meta.env.VITE_APP_VERSION": JSON.stringify(BASE_APP_VERSION),
},
publicDir: ssrBuild ? false : "public",
build: {
outDir: ssrBuild ? "dist/server" : "dist",
ssrManifest: !ssrBuild,
target: ssrBuild ? "node20" : undefined,
emptyOutDir: !ssrBuild,
rollupOptions: {
input: ssrBuild ? undefined : "index.html",
},
},
ssr: {
noExternal: ["react-router", "react-router-dom"],
},
};
});