-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvite.config.ts
73 lines (71 loc) · 1.69 KB
/
vite.config.ts
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
/*
* @Date: 2023-07-27 22:35:12
* @LastEditors: Please set LastEditors
* @LastEditTime: 2023-08-11 19:06:45
* @FilePath: /ai-tool-web/vite.config.ts
*/
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import * as path from 'path'
export default defineConfig({
resolve: {
alias: {
'@': path.resolve(__dirname, 'src')
}
},
css: {
preprocessorOptions: {
scss: {
additionalData: '@use "@/styles/index.scss" as *;'
}
}
},
plugins: [vue()],
build: {
rollupOptions: {
output: {
manualChunks: {
'naive-ui': ['naive-ui']
}
}
}
},
server: {
port: 3000,
hmr: {
host: 'localhost',
port: 3000
},
// 设置代理
proxy: {
'/ai': {
target: 'http://0.0.0.0:8000',
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/ai/, '')
},
'/api': {
target: 'http://gpt-meeting-service:8000',
// target: 'http://0.0.0.0:8000',
changeOrigin: true
// rewrite: (path: string) => path.replace(/^\/api/, '')
},
'/image': {
target: 'http://gpt-meeting-service:8000',
// target: 'http://0.0.0.0:8000',
changeOrigin: true
// rewrite: (path: string) => path.replace(/^\/api/, '')
},
'/yml': {
target: 'http://gpt-meeting-service:8000',
// target: 'http://0.0.0.0:8000',
changeOrigin: true
// rewrite: (path: string) => path.replace(/^\/api/, '')
},
'/openai': {
target: 'https://api.openai.com',
changeOrigin: true,
rewrite: (path: string) => path.replace(/^\/openai/, '')
}
}
}
})