mirror of
https://github.com/DorkSquadRR/DorkNet.git
synced 2026-10-26 15:38:45 -07:00
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:
@@ -7,7 +7,15 @@ import path from 'node:path';
|
|||||||
// up at admin.localhost without any extra publish wiring.
|
// up at admin.localhost without any extra publish wiring.
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
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: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': path.resolve(__dirname, 'src'),
|
'@': path.resolve(__dirname, 'src'),
|
||||||
|
|||||||
@@ -8,7 +8,10 @@ import path from 'node:path';
|
|||||||
// any extra publish wiring.
|
// any extra publish wiring.
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react()],
|
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://<apex>/__dn/www/`.
|
||||||
|
base: './',
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: { '@': path.resolve(__dirname, 'src') },
|
alias: { '@': path.resolve(__dirname, 'src') },
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user