Files
paper-doc/frontend/vite.config.ts
T

31 lines
877 B
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,
// 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,
},
},
},
})