site/admin-ui: relative asset base for single-origin path prefix

Use base './' so built index.html references ./assets/... instead of
/assets/..., letting the SPAs work under the Easy Launcher's
single-origin path prefix (https://<apex>/__dn/admin/) as well as the
subdomain layout. Root-absolute paths would skip the prefix and 404.
This commit is contained in:
Alexa
2026-05-31 12:33:16 +03:00
parent a9518b08ab
commit 1eba8d9345
2 changed files with 13 additions and 2 deletions
+9 -1
View File
@@ -7,7 +7,15 @@ import path from 'node:path';
// up at admin.localhost without any extra publish wiring.
export default defineConfig({
plugins: [react()],
base: '/',
// Relative-base so the built index.html references its assets as
// `./assets/...` instead of `/assets/...`. Required when the SPA is
// served under a path prefix like the Easy Launcher's single-origin
// mode (`https://<apex>/__dn/admin/`) — a root-absolute asset path
// would skip the /__dn/admin/ prefix and 404 on the wrong server
// host. Still works fine for the subdomain case
// (`admin.<apex>/...`) since `./assets/...` resolves against the
// document URL in both shapes.
base: './',
resolve: {
alias: {
'@': path.resolve(__dirname, 'src'),