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
+4
View File
@@ -23,6 +23,10 @@ const cMapsDir = normalizePath(path.join(pdfjsDistPath, 'cmaps'));
* Do not configure any envs here.
*/
export default defineConfig({
// No trailing slash: the React Router dev server requires its `basename` to
// start with this raw value (see react-router.config.ts). Vite normalizes
// and joins asset URLs correctly either way.
base: process.env.NEXT_PUBLIC_BASE_PATH ? process.env.NEXT_PUBLIC_BASE_PATH.replace(/\/$/, '') : '/',
css: {
postcss: {
plugins: [tailwindcss, autoprefixer],