import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' const normalizeBase = (value) => { if (!value || value === '/') return '/' const withLeadingSlash = value.startsWith('/') ? value : `/${value}` return withLeadingSlash.endsWith('/') ? withLeadingSlash : `${withLeadingSlash}/` } // https://vitejs.dev/config/ export default defineConfig({ base: normalizeBase(process.env.VITE_APP_BASE_URL || '/'), plugins: [ vue(), ], resolve: { alias: { '@': fileURLToPath(new URL('./src', import.meta.url)) } } })