Skip to content

Commit 995ebfe

Browse files
committed
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
1 parent 140380b commit 995ebfe

File tree

3 files changed

+27
-23
lines changed

3 files changed

+27
-23
lines changed

public/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
onixbyte.dev

src/router/index.tsx

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,31 @@ import ContactPage from "@/page/contact"
99
* Main application router configuration using React Router v6.
1010
* Defines all routes and their corresponding components.
1111
*/
12-
const router = createBrowserRouter([
12+
const router = createBrowserRouter(
13+
[
14+
{
15+
path: "/",
16+
element: <App />,
17+
errorElement: <ErrorPage />,
18+
children: [
19+
{
20+
index: true,
21+
element: <HomePage />,
22+
},
23+
{
24+
path: "about",
25+
element: <AboutPage />,
26+
},
27+
{
28+
path: "contact",
29+
element: <ContactPage />,
30+
},
31+
],
32+
},
33+
],
1334
{
14-
path: "/",
15-
element: <App />,
16-
errorElement: <ErrorPage />,
17-
children: [
18-
{
19-
index: true,
20-
element: <HomePage />,
21-
},
22-
{
23-
path: "about",
24-
element: <AboutPage />,
25-
},
26-
{
27-
path: "contact",
28-
element: <ContactPage />,
29-
},
30-
],
31-
},
32-
], {
33-
basename: process.env.NODE_ENV === 'production' ? '/react-template' : '/'
34-
})
35+
basename: "/",
36+
}
37+
)
3538

3639
export default router

vite.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import tailwindcss from "@tailwindcss/vite"
66
// https://vite.dev/config/
77
export default defineConfig({
88
plugins: [react(), tailwindcss()],
9-
base: process.env.NODE_ENV === 'production' ? '/react-template/' : '/',
9+
base: "/",
1010
resolve: {
1111
alias: {
1212
"@": fileURLToPath(new URL("./src", import.meta.url)),

0 commit comments

Comments
 (0)