Skip to content

Use import.meta.env.BASE_URL#289

Merged
psvenk merged 2 commits intomainfrom
base_url
Jan 26, 2026
Merged

Use import.meta.env.BASE_URL#289
psvenk merged 2 commits intomainfrom
base_url

Conversation

@dtemkin1
Copy link
Copy Markdown
Collaborator

We fetch things from / a lot. When setting up the gh-pages branch for #284 testing, this was complicated since we were deploying from a subdirectory. Adding this now will make setting up a dev endpoint in the (possible) future easier.

@dtemkin1 dtemkin1 requested a review from psvenk January 26, 2026 00:20
Copy link
Copy Markdown
Member

@psvenk psvenk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would also set the base and basename properties, à la 26b87ec, and add a comment saying that these should be changed in the event of a non-root deployment. It looks like the Vite base can be set to "./" or "" to make all URLs relative, so the React Router basename should be the only thing that needs to change when building for deployment to a subdirectory.

@dtemkin1 dtemkin1 requested a review from psvenk January 26, 2026 03:26
@psvenk psvenk merged commit 20011d8 into main Jan 26, 2026
7 checks passed
@psvenk psvenk deleted the base_url branch January 26, 2026 04:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants