-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
89 lines (78 loc) · 2.53 KB
/
vite.config.ts
File metadata and controls
89 lines (78 loc) · 2.53 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
88
89
import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
// https://vite.dev/config/
export default defineConfig({
plugins: [react()],
define: {
'global': 'globalThis',
},
resolve: {
alias: {
buffer: 'buffer/',
},
},
build: {
rollupOptions: {
output: {
manualChunks(id) {
const inNodeModules = id.includes('/node_modules/') || id.includes('\\node_modules\\')
if (!inNodeModules) return undefined
if (id.includes('/@xyflow/react/') || id.includes('\\@xyflow\\react\\')) {
return 'vendor-flow'
}
if (
id.includes('/@monaco-editor/react/') ||
id.includes('\\@monaco-editor\\react\\') ||
id.includes('/monaco-editor/') ||
id.includes('\\monaco-editor\\')
) {
return 'vendor-monaco'
}
if (id.includes('/@google/genai/') || id.includes('\\@google\\genai\\')) {
return 'vendor-google'
}
if (
id.includes('/react-markdown/') ||
id.includes('\\react-markdown\\') ||
id.includes('/remark-gfm/') ||
id.includes('\\remark-gfm\\') ||
id.includes('/rehype-sanitize/') ||
id.includes('\\rehype-sanitize\\') ||
id.includes('/react-syntax-highlighter/') ||
id.includes('\\react-syntax-highlighter\\') ||
id.includes('/prismjs/') ||
id.includes('\\prismjs\\')
) {
return 'vendor-markdown'
}
if (id.includes('/@anthropic-ai/sdk/') || id.includes('\\@anthropic-ai\\sdk\\')) {
return 'vendor-anthropic'
}
if (id.includes('/openai/') || id.includes('\\openai\\')) {
return 'vendor-openai'
}
if (id.includes('/@modelcontextprotocol/sdk/') || id.includes('\\@modelcontextprotocol\\sdk\\')) {
return 'vendor-mcp'
}
if (
id.includes('/@xenova/transformers/') ||
id.includes('\\@xenova\\transformers\\') ||
id.includes('/onnxruntime-web/') ||
id.includes('\\onnxruntime-web\\')
) {
return 'vendor-memory'
}
if (
id.includes('/gray-matter/') ||
id.includes('\\gray-matter\\') ||
id.includes('/js-yaml/') ||
id.includes('\\js-yaml\\')
) {
return 'vendor-parsing'
}
return undefined
},
},
},
},
})