import { defineConfig, loadEnv } from 'vite'; import react from '@vitejs/plugin-react'; // https://vitejs.dev/config/ export default defineConfig(({ mode }) => { // Load env file based on `mode` in the current working directory. const env = loadEnv(mode, process.cwd(), ''); const basePath = env.VITE_BASE_PATH || '/'; return { base: basePath, plugins: [react()], publicDir: 'public', build: { outDir: '../../../dist/frontend', }, server: { proxy: { '/api': { target: 'http://localhost:5172', changeOrigin: true, }, }, }, }; });