-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
73 lines (71 loc) · 1.79 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
63
64
65
66
67
68
69
70
71
72
73
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react";
import themePlugin from "@replit/vite-plugin-shadcn-theme-json";
import path, { dirname } from "path";
import checker from "vite-plugin-checker";
import runtimeErrorOverlay from "@replit/vite-plugin-runtime-error-modal"
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
export default defineConfig({
plugins: [
react(),
checker({ typescript: true, overlay: false }),
runtimeErrorOverlay(),
themePlugin(),
],
resolve: {
alias: {
"@": path.resolve(__dirname, "client", "src"),
"@db": path.resolve(__dirname, "db"),
"@components": path.resolve(__dirname, "client", "src", "components")
},
},
root: path.resolve(__dirname, "client"),
build: {
outDir: path.resolve(__dirname, "dist/public"),
emptyOutDir: true,
target: 'esnext',
minify: 'esbuild',
rollupOptions: {
output: {
manualChunks: {
'vendor': [
'react',
'react-dom',
'ethers',
'@tanstack/react-query',
'd3',
'recharts'
],
'monaco': ['@monaco-editor/react', 'monaco-editor'],
'ui': [
'@radix-ui/react-accordion',
'@radix-ui/react-alert-dialog',
'@radix-ui/react-dialog',
'@radix-ui/react-tabs'
]
}
}
}
},
optimizeDeps: {
include: ['react', 'react-dom', 'ethers'],
exclude: ['@monaco-editor/react']
},
server: {
proxy: {
'/api': {
target: 'http://localhost:5000',
changeOrigin: true,
secure: false
}
},
hmr: {
overlay: false
},
watch: {
usePolling: false
}
}
});