Skip to content

Commit 0ba8da3

Browse files
committed
feat(router): add basename configuration for production env
Update router configuration to use '/react-template' as basename in production and '/' in development. Also update index.html title to reflect project name.
1 parent b90b253 commit 0ba8da3

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7-
<title>Vite + React + TS</title>
7+
<title>OnixByte React Template</title>
88
</head>
99
<body>
1010
<div id="root"></div>

src/router/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const router = createBrowserRouter([
2929
},
3030
],
3131
},
32-
])
32+
], {
33+
basename: process.env.NODE_ENV === 'production' ? '/react-template' : '/'
34+
})
3335

3436
export default router

0 commit comments

Comments
 (0)