From 1eba8d9345f00df3ff2158171aa2910cc40d6ded Mon Sep 17 00:00:00 2001 From: Alexa <53471801+Alexa-RR@users.noreply.github.com> Date: Sun, 31 May 2026 12:33:16 +0300 Subject: [PATCH] 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:///__dn/admin/) as well as the subdomain layout. Root-absolute paths would skip the prefix and 404. --- DorkNet.Server/admin-ui/vite.config.ts | 10 +++++++++- DorkNet.Server/site/vite.config.ts | 5 ++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DorkNet.Server/admin-ui/vite.config.ts b/DorkNet.Server/admin-ui/vite.config.ts index 4c8a103..515605f 100644 --- a/DorkNet.Server/admin-ui/vite.config.ts +++ b/DorkNet.Server/admin-ui/vite.config.ts @@ -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:///__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./...`) since `./assets/...` resolves against the + // document URL in both shapes. + base: './', resolve: { alias: { '@': path.resolve(__dirname, 'src'), diff --git a/DorkNet.Server/site/vite.config.ts b/DorkNet.Server/site/vite.config.ts index aa93205..0674b7e 100644 --- a/DorkNet.Server/site/vite.config.ts +++ b/DorkNet.Server/site/vite.config.ts @@ -8,7 +8,10 @@ import path from 'node:path'; // any extra publish wiring. export default defineConfig({ plugins: [react()], - base: '/', + // Relative-base — see admin-ui/vite.config.ts. Same single-origin + // path-prefix scenario applies if the site ever gets opened through + // `https:///__dn/www/`. + base: './', resolve: { alias: { '@': path.resolve(__dirname, 'src') }, },