AIx_Smarttalk/electron.vite.config.mjs

57 lines
1.5 KiB
JavaScript
Raw Normal View History

2024-07-08 16:24:56 +08:00
import { resolve } from 'path'
2024-07-11 14:30:08 +08:00
import path from 'path'
2024-07-08 16:24:56 +08:00
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import WindiCSS from "vite-plugin-windicss"
2024-09-20 16:56:26 +08:00
/*import electron from 'vite-plugin-electron'
plugins: [electron({
main: {
builderOptions: {
asar: false
}
}
})],*/
2024-07-08 16:24:56 +08:00
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
2024-07-11 14:30:08 +08:00
// '@': resolve('./src/renderer/src'),
// '@': path.resolve(__dirname, 'src/renderer/src'),
'@': path.join(__dirname, './src/renderer/src'),
2024-07-25 13:24:31 +08:00
'@root': path.join(__dirname, '.'),
2024-07-08 16:24:56 +08:00
}
},
server: {
proxy: {
'/dev-api': {
target: 'http://27.128.240.72:7865',
2024-09-10 09:52:10 +08:00
// target: 'http://36.134.181.164:7863',
// target: 'http://192.168.2.52:7863',
2024-07-08 16:24:56 +08:00
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
2024-09-20 16:51:54 +08:00
},
'/baidubce': {
target: 'https://aip.baidubce.com',
ws: true,
changeOrigin: true,
rewrite: (p) => p.replace(/^\/baidubce/, '')
},
2024-10-15 16:30:07 +08:00
'/parth': {
target: 'https://zwapi.xfyun.cn', // 第三方API的地址
changeOrigin: true, // 改变请求的起源
rewrite: (path) => path.replace(/^\/parth/, '') // 重写路径
},
2024-07-08 16:24:56 +08:00
},
},
plugins: [vue(), WindiCSS()],
assetsInclude:('**/*.woff', '**/*.woff2', '**/*.ttf'),
}
})