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.
This commit is contained in:
2025-09-15 20:33:51 +08:00
parent b90b253785
commit 0ba8da3420
2 changed files with 4 additions and 2 deletions
+1 -1
View File
@@ -4,7 +4,7 @@
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> <link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title> <title>OnixByte React Template</title>
</head> </head>
<body> <body>
<div id="root"></div> <div id="root"></div>
+3 -1
View File
@@ -29,6 +29,8 @@ const router = createBrowserRouter([
}, },
], ],
}, },
]) ], {
basename: process.env.NODE_ENV === 'production' ? '/react-template' : '/'
})
export default router export default router