Files
nl-game/vite.config.js
李琦 cd1ab90013 初始化
需要注意的是饥荒不够完善:动作、手持工具、细节交互、系统逻辑
2026-08-15 07:24:34 +08:00

17 lines
466 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// Vite 构建配置Vue 插件 + 开发代理API 与 WebSocket 转发到 Gin 后端 8080
import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
export default defineConfig({
plugins: [vue()],
server: {
port: 5173,
proxy: {
// REST 接口代理
'/api': { target: 'http://127.0.0.1:8080', changeOrigin: true },
// WebSocket 对战代理
'/ws': { target: 'ws://127.0.0.1:8080', ws: true },
},
},
})