-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy pathvite.config.js
More file actions
executable file
·49 lines (46 loc) · 1.39 KB
/
vite.config.js
File metadata and controls
executable file
·49 lines (46 loc) · 1.39 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
import { defineConfig, loadEnv } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig(({ command, mode }) => {
// Load env file based on `mode` in the current working directory.
const env = loadEnv(mode, process.cwd(), '')
return {
plugins: [react()],
server: {
host: env.VITE_HOST || '::',
port: parseInt(env.VITE_PORT) || 5173,
proxy: {
'/api': `http://localhost:${env.PORT || 3001}`,
'/ws': {
target: `ws://localhost:${env.PORT || 3001}`,
ws: true
},
'/shell': {
target: `ws://localhost:${env.PORT || 3001}`,
ws: true
}
}
},
build: {
outDir: 'dist',
chunkSizeWarningLimit: 1000,
rollupOptions: {
output: {
manualChunks: {
'vendor-react': ['react', 'react-dom', 'react-router-dom'],
'vendor-codemirror': [
'@uiw/react-codemirror',
'@codemirror/lang-css',
'@codemirror/lang-html',
'@codemirror/lang-javascript',
'@codemirror/lang-json',
'@codemirror/lang-markdown',
'@codemirror/lang-python',
'@codemirror/theme-one-dark'
],
'vendor-xterm': ['@xterm/xterm', '@xterm/addon-fit', '@xterm/addon-clipboard', '@xterm/addon-webgl']
}
}
}
}
}
})