forked from A-Archives-and-Forks/metro_studio
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvite.config.js
More file actions
56 lines (53 loc) · 1.48 KB
/
vite.config.js
File metadata and controls
56 lines (53 loc) · 1.48 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
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { readFileSync } from 'fs'
import { resolve } from 'path'
const packageJson = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8'))
const commonProxy = {
'/api/ollama': {
target: 'http://127.0.0.1:11434',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/ollama/, ''),
},
'/api/overpass': {
target: 'https://overpass-api.de',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/overpass/, '/api/interpreter'),
},
'/api/overpass-kumi': {
target: 'https://overpass.kumi.systems',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/overpass-kumi/, '/api/interpreter'),
},
'/api/nominatim': {
target: 'https://nominatim.openstreetmap.org',
changeOrigin: true,
rewrite: (path) => path.replace(/^\/api\/nominatim/, ''),
},
}
// https://vite.dev/config/
export default defineConfig({
plugins: [vue()],
define: {
__APP_VERSION__: JSON.stringify(packageJson.version),
'import.meta.env.__APP_VERSION__': JSON.stringify(packageJson.version),
},
envPrefix: ['VITE_', 'LLM_'],
build: {
rollupOptions: {
output: {
manualChunks: {
vue: ['vue', 'pinia'],
map: ['maplibre-gl'],
turf: ['@turf/helpers', '@turf/bbox', '@turf/boolean-point-in-polygon'],
},
},
},
},
server: {
proxy: commonProxy,
},
preview: {
proxy: commonProxy,
},
})