2025-12-25 22:40:56 +08:00
|
|
|
import { defineConfig } from 'vite'
|
|
|
|
|
import vue from '@vitejs/plugin-vue'
|
|
|
|
|
|
|
|
|
|
// https://vite.dev/config/
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
plugins: [vue()],
|
|
|
|
|
server: {
|
|
|
|
|
proxy: {
|
|
|
|
|
'/api': {
|
2025-12-26 18:24:28 +08:00
|
|
|
// Force IPv4 to avoid Windows resolving `localhost` -> `::1` (IPv6) and causing ECONNREFUSED
|
|
|
|
|
target: 'http://127.0.0.1:8080',
|
2025-12-25 22:40:56 +08:00
|
|
|
changeOrigin: true,
|
|
|
|
|
rewrite: (path) => path.replace(/^\/api/, ''),
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
})
|