35 lines
1.1 KiB
TypeScript
35 lines
1.1 KiB
TypeScript
import { fileURLToPath, URL } from 'node:url'
|
|
|
|
import { defineConfig } from 'vite'
|
|
import vue from '@vitejs/plugin-vue'
|
|
import vueDevTools from 'vite-plugin-vue-devtools'
|
|
|
|
// https://vite.dev/config/
|
|
export default defineConfig({
|
|
plugins: [vue(), vueDevTools()],
|
|
resolve: {
|
|
alias: {
|
|
'@': fileURLToPath(new URL('./src', import.meta.url)),
|
|
},
|
|
},
|
|
server: {
|
|
port: 5173,
|
|
// Listen on all interfaces so the dev server is reachable from the LAN
|
|
// (e.g. http://192.168.1.88:5173), not just from localhost.
|
|
host: true,
|
|
// Fail loudly if 5173 is taken instead of silently moving to 5174. Without
|
|
// this, a stray process on 5173 makes the server drift to the next free
|
|
// port and the documented URL quietly stops working.
|
|
strictPort: true,
|
|
// The SPA calls the same-origin '/api' prefix. In development Vite
|
|
// forwards those requests to the FastAPI process, so the browser stays on
|
|
// one origin and no CORS configuration is needed.
|
|
proxy: {
|
|
'/api': {
|
|
target: 'http://127.0.0.1:8000',
|
|
changeOrigin: true,
|
|
},
|
|
},
|
|
},
|
|
})
|