Skip to content

Commit 617ca5e

Browse files
committed
feat: configure base paths for production deployment
Set basename in router and base in vite config for production environment Update favicon and fix deploy workflow newline
1 parent c8083c6 commit 617ca5e

File tree

4 files changed

+6
-2
lines changed

4 files changed

+6
-2
lines changed

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/svg+xml" href="/onixbyte.svg" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<title>OnixByte React Template</title>
88
</head>

src/assets/OnixByte.svg

Lines changed: 1 addition & 0 deletions
Loading

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

vite.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +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/' : '/',
910
resolve: {
1011
alias: {
1112
"@": fileURLToPath(new URL("./src", import.meta.url)),

0 commit comments

Comments
 (0)