AIx_Smarttalk_WS/electron.vite.config.mjs

71 lines
1.9 KiB
JavaScript
Raw Permalink Normal View History

2024-10-25 14:38:32 +08:00
import { resolve } from 'path'
import path from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import WindiCSS from "vite-plugin-windicss"
2024-11-19 16:19:13 +08:00
import vitePpt from './src/renderer/src/plugins/vite-ppt'
2024-10-25 14:38:32 +08:00
/*import electron from 'vite-plugin-electron'
plugins: [electron({
main: {
builderOptions: {
asar: false
}
}
})],*/
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
},
preload: {
plugins: [externalizeDepsPlugin()]
},
renderer: {
resolve: {
alias: {
// '@': resolve('./src/renderer/src'),
// '@': path.resolve(__dirname, 'src/renderer/src'),
'@': path.join(__dirname, './src/renderer/src'),
'@root': path.join(__dirname, '.'),
}
},
server: {
proxy: {
'/dev-api': {
target: 'http://27.128.240.72:7865',
// target: 'https://prev.ysaix.com:7868/prod-api/',
2024-10-25 14:38:32 +08:00
// target: 'http://36.134.181.164:7863',
2024-12-04 16:28:52 +08:00
// target: 'http://192.168.0.102:7865',
2024-10-25 14:38:32 +08:00
changeOrigin: true,
rewrite: (p) => p.replace(/^\/dev-api/, '')
},
'/baidubce': {
target: 'https://aip.baidubce.com',
ws: true,
changeOrigin: true,
rewrite: (p) => p.replace(/^\/baidubce/, '')
},
'/parth': {
target: 'https://zwapi.xfyun.cn', // 第三方API的地址
changeOrigin: true, // 改变请求的起源
rewrite: (path) => path.replace(/^\/parth/, '') // 重写路径
},
2024-11-19 17:08:34 +08:00
'/api': {
2024-11-06 17:33:32 +08:00
target: 'https://ai.ysaix.com:7864',
changeOrigin: true,
2024-11-19 17:08:34 +08:00
pathRewrite: { '^/api': '' }
2024-11-06 17:33:32 +08:00
}
2024-10-25 14:38:32 +08:00
},
},
2024-11-19 16:19:13 +08:00
plugins: [vue(), WindiCSS(),vitePpt()],
2024-10-25 14:38:32 +08:00
assetsInclude:('**/*.woff', '**/*.woff2', '**/*.ttf'),
2024-11-18 17:31:01 +08:00
css: {
preprocessorOptions: {
scss: {
silenceDeprecations: ['legacy-js-api']
}
}
}
2024-10-25 14:38:32 +08:00
}
})