HR-ATS-Portal/frontend/vite.config.js

22 lines
846 B
JavaScript

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import path from 'path'
import { fileURLToPath } from 'url'
const __dirname = path.dirname(fileURLToPath(import.meta.url))
// One SPA at `/`. The auth screens keep /auth/* as *router* paths so the
// backend's CONFIRM_EMAIL_PATH=/auth/confirm-email links resolve unchanged.
//
// `vite dev` and `vite preview` both serve index.html for unmatched paths, which
// is what devserver.py's SPA_ROOTS hack used to fake — and they do it for every
// path, not just /auth/. A CDN/S3 deploy needs an equivalent rewrite rule.
export default defineConfig({
plugins: [react()],
base: '/',
build: { outDir: 'dist', emptyOutDir: true, sourcemap: true },
resolve: { alias: { '@': path.resolve(__dirname, 'src') } },
server: { port: 5173 },
preview: { port: 4173 },
})