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" /*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: 'http://36.134.181.164:7863', // target: 'http://192.168.2.52:7863', 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/, '') // 重写路径 }, '/api': { target: 'https://ai.ysaix.com:7864', changeOrigin: true, pathRewrite: { '^/api': '' } } }, }, plugins: [vue(), WindiCSS()], assetsInclude:('**/*.woff', '**/*.woff2', '**/*.ttf'), css: { preprocessorOptions: { scss: { silenceDeprecations: ['legacy-js-api'] } } } } })