-
-
Notifications
You must be signed in to change notification settings - Fork 25
Expand file tree
/
Copy pathvite.config.ts
More file actions
51 lines (50 loc) · 1.27 KB
/
Copy pathvite.config.ts
File metadata and controls
51 lines (50 loc) · 1.27 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 { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import tailwindcss from '@tailwindcss/vite'
import pkg from './package.json'
export default defineConfig(() => {
return {
plugins: [react(), tailwindcss()],
define: {
__APP_VERSION__: JSON.stringify(pkg.version),
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
if (id.includes('node_modules')) {
if (id.includes('react') || id.includes('scheduler')) return 'vendor'
if (id.includes('@tanstack')) return 'vendor'
if (
id.includes('vaul') ||
id.includes('react-remove-scroll') ||
id.includes('use-callback-ref') ||
id.includes('use-sidecar') ||
id.includes('react-style-singleton') ||
id.includes('aria-hidden') ||
id.includes('@radix-ui')
)
return 'vendor'
if (id.includes('jszip')) return 'jszip'
const match = id.match(/node_modules\/(?:\.pnpm\/)?([^@/][^/]*)/)
if (match) return `lib-${match[1]}`
}
},
},
},
},
server: {
proxy: {
'/api/instances': {
target: 'http://localhost:3000',
changeOrigin: true,
timeout: 120000,
},
'/api': {
target: 'http://localhost:3000',
changeOrigin: true,
},
},
},
}
})