-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (50 loc) · 1.11 KB
/
vite.config.ts
File metadata and controls
51 lines (50 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
51
import { tanstackRouter } from "@tanstack/router-plugin/vite";
import react from "@vitejs/plugin-react";
import { visualizer } from "rollup-plugin-visualizer";
import { defineConfig } from "vite";
// https://vite.dev/config/
export default defineConfig({
devtools: {
enabled: true,
},
plugins: [
tanstackRouter(),
react(),
...(process.env.ANALYZE
? [
visualizer({
filename: "dist/stats.html",
gzipSize: true,
brotliSize: true,
}),
]
: []),
],
build: {
rollupOptions: {
output: {
manualChunks: (id) => {
if (id.includes("node_modules/react") || id.includes("node_modules/react-dom")) {
return "react";
}
if (id.includes("node_modules/@tanstack")) {
return "tanstack";
}
},
},
},
},
server: {
proxy: {
"/api": {
target: "http://127.0.0.1:8000",
changeOrigin: true,
secure: false,
ws: true,
},
},
watch: {
ignored: ["**/frontier/**", "**/.venv/**"],
},
},
});