fix: use absolute vite base so SPA deep links don't white-screen (#336)

With base '' the built index.html references assets relatively
(./assets/*). On deep links like /listings/listing/:id the browser
resolves those below the route path, the SPA fallback answers with
index.html and the page dies trying to execute HTML as a JS module.
Notification emails link directly to listing details, so every
'Open in fredy' link landed on a white screen.
This commit is contained in:
Michel
2026-06-10 16:44:39 +02:00
committed by GitHub
parent 7a2dacaa61
commit c17a815263

View File

@@ -7,7 +7,10 @@ import react from '@vitejs/plugin-react';
import { defineConfig } from 'vite'; import { defineConfig } from 'vite';
// https://vitejs.dev/config/ // https://vitejs.dev/config/
export default defineConfig({ export default defineConfig({
base: '', // Must be absolute: with a relative base, asset URLs in index.html break on
// deep links like /listings/listing/:id (the SPA fallback serves index.html,
// but ./assets/* then resolves below the route path and loads HTML as JS).
base: '/',
build: { build: {
chunkSizeWarningLimit: 9999999, chunkSizeWarningLimit: 9999999,
outDir: './ui/public', outDir: './ui/public',