Skip to content

Commit 6efff9d

Browse files
committed
Set base URL for routing in BrowserRouter and update Vite config for deployment
1 parent 17f47f7 commit 6efff9d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ if (!rootEl) {
1515

1616
createRoot(rootEl).render(
1717
<StrictMode>
18-
<BrowserRouter>
18+
<BrowserRouter basename={import.meta.env.BASE_URL}>
1919
<Routes>
2020
<Route element={<Layout />}>
2121
<Route element={<Timer />} path="/" />

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { defineConfig } from "vite";
33

44
// https://vite.dev/config/
55
export default defineConfig({
6-
base: process.env.GITHUB_ACTIONS ? "/race-timer/" : "/",
6+
base: "/race-timer",
77
plugins: [
88
react({
99
babel: {

0 commit comments

Comments
 (0)