fix: use relative asset paths with always-injected <base> tag
Switch Vite base back to './' (relative paths) and always inject
<base href="${BASE_PATH}"> in the entrypoint, even when BASE_PATH=/.
This fixes asset loading for both deployment modes:
- Single-instance: <base href="/"> resolves ./assets/x.js to /assets/x.js
- SaaS tenant: <base href="/t/slug/"> resolves to /t/slug/assets/x.js
Previously base:'/' produced absolute /assets/ paths that the <base>
tag couldn't redirect, breaking SaaS tenants. And base:'./' without
<base> broke deep URLs in single-instance mode. Always injecting the
tag makes relative paths work universally.
The patched server-ui-entrypoint.sh in cameleer-saas (which rewrote
absolute href/src attributes via sed) is no longer needed and can be
removed.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -27,7 +27,7 @@ export default defineConfig({
|
||||
optimizeDeps: {
|
||||
include: ['swagger-ui-dist/swagger-ui-bundle'],
|
||||
},
|
||||
base: '/',
|
||||
base: './',
|
||||
build: {
|
||||
outDir: 'dist',
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user