build: update base URL and router configuration for custom domain

Update Vite config and router basename to use root path for production
Add CNAME file for custom domain deployment
This commit is contained in:
2025-09-15 22:57:30 +08:00
parent 140380b1ab
commit 995ebfeb34
3 changed files with 27 additions and 23 deletions
+1
View File
@@ -0,0 +1 @@
onixbyte.dev
+7 -4
View File
@@ -9,7 +9,8 @@ import ContactPage from "@/page/contact"
* Main application router configuration using React Router v6.
* Defines all routes and their corresponding components.
*/
const router = createBrowserRouter([
const router = createBrowserRouter(
[
{
path: "/",
element: <App />,
@@ -29,8 +30,10 @@ const router = createBrowserRouter([
},
],
},
], {
basename: process.env.NODE_ENV === 'production' ? '/react-template' : '/'
})
],
{
basename: "/",
}
)
export default router
+1 -1
View File
@@ -6,7 +6,7 @@ import tailwindcss from "@tailwindcss/vite"
// https://vite.dev/config/
export default defineConfig({
plugins: [react(), tailwindcss()],
base: process.env.NODE_ENV === 'production' ? '/react-template/' : '/',
base: "/",
resolve: {
alias: {
"@": fileURLToPath(new URL("./src", import.meta.url)),