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:
@@ -0,0 +1 @@
|
|||||||
|
onixbyte.dev
|
||||||
+25
-22
@@ -9,28 +9,31 @@ import ContactPage from "@/page/contact"
|
|||||||
* Main application router configuration using React Router v6.
|
* Main application router configuration using React Router v6.
|
||||||
* Defines all routes and their corresponding components.
|
* Defines all routes and their corresponding components.
|
||||||
*/
|
*/
|
||||||
const router = createBrowserRouter([
|
const router = createBrowserRouter(
|
||||||
|
[
|
||||||
|
{
|
||||||
|
path: "/",
|
||||||
|
element: <App />,
|
||||||
|
errorElement: <ErrorPage />,
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
index: true,
|
||||||
|
element: <HomePage />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "about",
|
||||||
|
element: <AboutPage />,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: "contact",
|
||||||
|
element: <ContactPage />,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
{
|
{
|
||||||
path: "/",
|
basename: "/",
|
||||||
element: <App />,
|
}
|
||||||
errorElement: <ErrorPage />,
|
)
|
||||||
children: [
|
|
||||||
{
|
|
||||||
index: true,
|
|
||||||
element: <HomePage />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "about",
|
|
||||||
element: <AboutPage />,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
path: "contact",
|
|
||||||
element: <ContactPage />,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
], {
|
|
||||||
basename: process.env.NODE_ENV === 'production' ? '/react-template' : '/'
|
|
||||||
})
|
|
||||||
|
|
||||||
export default router
|
export default router
|
||||||
|
|||||||
+1
-1
@@ -6,7 +6,7 @@ import tailwindcss from "@tailwindcss/vite"
|
|||||||
// https://vite.dev/config/
|
// https://vite.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [react(), tailwindcss()],
|
plugins: [react(), tailwindcss()],
|
||||||
base: process.env.NODE_ENV === 'production' ? '/react-template/' : '/',
|
base: "/",
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
"@": fileURLToPath(new URL("./src", import.meta.url)),
|
||||||
|
|||||||
Reference in New Issue
Block a user