-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvite.config.js
More file actions
87 lines (78 loc) · 2.23 KB
/
Copy pathvite.config.js
File metadata and controls
87 lines (78 loc) · 2.23 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
export default defineConfig({
plugins: [react()],
build: {
rollupOptions: {
output: {
manualChunks(id) {
const normalizedId = id.replace(/\\/g, '/');
if (!normalizedId.includes('/node_modules/')) {
return undefined;
}
if (
normalizedId.includes('/react/') ||
normalizedId.includes('/react-dom/') ||
normalizedId.includes('/react-router-dom/') ||
normalizedId.includes('/scheduler/')
) {
return 'react-vendor';
}
if (normalizedId.includes('/ag-psd/')) {
return 'psd-vendor';
}
if (normalizedId.includes('/xlsx/')) {
return 'spreadsheet-vendor';
}
if (
normalizedId.includes('/react-moveable/') ||
normalizedId.includes('/react-selecto/') ||
normalizedId.includes('/react-xarrows/') ||
normalizedId.includes('/react-zoom-pan-pinch/') ||
normalizedId.includes('/moveable/') ||
normalizedId.includes('/selecto/')
) {
return 'canvas-vendor';
}
if (normalizedId.includes('/lucide-react/') || normalizedId.includes('/framer-motion/')) {
return 'ui-vendor';
}
if (
normalizedId.includes('/html-to-image/') ||
normalizedId.includes('/jszip/') ||
normalizedId.includes('/buffer/') ||
normalizedId.includes('/process/')
) {
return 'export-vendor';
}
return 'vendor';
},
},
},
},
server: {
host: '0.0.0.0',
port: 3020,
watch: {
ignored: ['**/logs/**', '**/output/**'],
},
proxy: {
'/api': {
target: 'http://localhost:3001',
changeOrigin: true,
},
'/templates': {
target: 'http://localhost:3001',
changeOrigin: true,
},
'/3-字体': {
target: 'http://localhost:3001',
changeOrigin: true,
},
'/3-%E5%AD%97%E4%BD%93': {
target: 'http://localhost:3001',
changeOrigin: true,
},
},
},
})