import { fileURLToPath, URL } from 'node:url'; import { defineConfig } from 'vite'; import vue from '@vitejs/plugin-vue'; export default defineConfig({ plugins: [ vue() ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } }, server: { port: 3000, host: '0.0.0.0', strictPort: true, open: true, proxy: { '/api': { target: 'http://127.0.0.1:8000', changeOrigin: true, secure: false, rewrite: (path) => path, followRedirects: true, // Ensure 307 redirects are handled correctly } } }, preview: { port: 3000, host: '0.0.0.0', strictPort: true } });