Files
37duAutomation/desktop/electron-shell/frontend/vite.config.js
T

20 lines
586 B
JavaScript

import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
// dev 时把 /api 与 /ws 代理到 FastAPI 后端,实现前后端分离开发
export default defineConfig({
plugins: [vue()],
server: {
port: 5173,
strictPort: true,
proxy: {
'/api': { target: 'http://127.0.0.1:8799', changeOrigin: true },
'/ws': { target: 'ws://127.0.0.1:8799', ws: true },
},
},
build: {
// 构建产物直接输出到壳的渲染层目录(Electron 壳/CLI 服务以此为前端根)
outDir: '../renderer/dist',
emptyOutDir: true,
},
})