feat(remix): support serving app under a sub-path via NEXT_PUBLIC_BASE_PATH (#2824)

This commit is contained in:
Christopher Ryan
2026-08-12 16:12:28 +10:00
committed by GitHub
parent 962cffc9f5
commit 1bd09480e6
27 changed files with 189 additions and 50 deletions
+5
View File
@@ -3,4 +3,9 @@ import type { Config } from '@react-router/dev/config';
export default {
appDirectory: 'app',
ssr: true,
// Must never be undefined and must start with the raw Vite `base` value,
// otherwise @react-router/dev crashes / exits on `react-router dev`. Both are
// kept without a trailing slash so they match exactly, and so the bare
// sub-path URL (e.g. "/ESign") still matches the basename at runtime.
basename: process.env.NEXT_PUBLIC_BASE_PATH ? process.env.NEXT_PUBLIC_BASE_PATH.replace(/\/$/, '') : '/',
} satisfies Config;