-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathelectron.vite.config.ts
35 lines (34 loc) · 1.01 KB
/
electron.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
import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import react from '@vitejs/plugin-react'
import svgr from 'vite-plugin-svgr'
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin({ exclude: ['clipboardy'] })]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
server: {
proxy: {
'/api/openai': {
target: 'https://service-8w4ctcv6-1317242412.hk.apigw.tencentcs.com/openai',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/api\/openai/, '')
},
'/api/googleapis': {
target: 'https://service-8w4ctcv6-1317242412.hk.apigw.tencentcs.com/googleapis',
changeOrigin: true,
secure: false,
rewrite: (path) => path.replace(/^\/api\/googleapis/, '')
}
}
},
resolve: {
alias: [{ find: '@renderer', replacement: resolve('src/renderer/src') }]
},
plugins: [react(), svgr()]
}
})