mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
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:
@@ -7,7 +7,10 @@ import react from '@vitejs/plugin-react';
|
||||
import { defineConfig } from 'vite';
|
||||
// https://vitejs.dev/config/
|
||||
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: {
|
||||
chunkSizeWarningLimit: 9999999,
|
||||
outDir: './ui/public',
|
||||
|
||||
Reference in New Issue
Block a user