forked from Etamus/NeveAI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.ts
More file actions
108 lines (105 loc) · 2.41 KB
/
Copy pathvite.config.ts
File metadata and controls
108 lines (105 loc) · 2.41 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { viteStaticCopy } from 'vite-plugin-static-copy';
import { visualizer } from 'rollup-plugin-visualizer';
export default defineConfig({
plugins: [
sveltekit(),
viteStaticCopy({
targets: [
{
src: 'node_modules/onnxruntime-web/dist/*.jsep.*',
dest: 'wasm'
}
]
}),
visualizer({
filename: 'build/stats.html',
open: false,
gzipSize: true,
brotliSize: true
})
],
define: {
APP_VERSION: JSON.stringify(process.env.npm_package_version),
APP_BUILD_HASH: JSON.stringify(process.env.APP_BUILD_HASH || 'dev-build')
},
build: {
sourcemap: false,
// esbuild é muito mais rápido e leve que o Terser (minificador padrão do rollup)
minify: 'esbuild',
// Desativa o cálculo de tamanho comprimido (re-lê todos os arquivos gerados — desnecessário)
reportCompressedSize: false,
rollupOptions: {
// Limita I/O paralelo para não saturar o disco (padrão é ilimitado)
maxParallelFileOps: 15
}
},
worker: {
format: 'es'
},
esbuild: {
pure: process.env.ENV === 'dev' ? [] : ['console.log', 'console.debug', 'console.error']
},
server: {
// Impede que o Vite/chokidar vasculhe pastas que não são código frontend
// (backend/venv tem 2GB/56k arquivos — sem isso o build trava o sistema)
watch: {
ignored: [
'**/backend/**',
'**/cypress/**',
'**/test/**',
'**/static/pyodide/**',
'**/static/sql.js/**',
'**/static/audio/**'
]
},
proxy: {
'/dbg': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/api': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/llamacpp': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/ws': {
target: 'http://localhost:8080',
changeOrigin: true,
ws: true
},
'/ollama': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/openai': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/audio': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/images': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/retrieval': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/health': {
target: 'http://localhost:8080',
changeOrigin: true
},
'/static': {
target: 'http://localhost:8080',
changeOrigin: true
}
}
}
});