diff --git a/package.json b/package.json index 242717b..9c21e2e 100644 --- a/package.json +++ b/package.json @@ -37,5 +37,6 @@ "typescript-eslint": "^8.10.0", "vite": "^5.4.9" }, + "homepage": "https://avo.github.io/", "packageManager": "yarn@4.5.1" } diff --git a/src/App.tsx b/src/App.tsx index 6724aaa..d7817bf 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -9,35 +9,38 @@ import { baseStyle } from './styles/Base'; import { elementStyle } from './styles/Element'; import { themeStyle } from './styles/Theme'; -const router = createBrowserRouter([ - { - children: [ - { - element: , - index: true, - }, - { - element: , - path: '/about', - }, - { - element: , - path: '/blog', - }, - { - element: , - path: '/error', - }, - { - element: , - path: '*', - }, - ], - element: , - errorElement: , - path: '/', - }, -]); +const router = createBrowserRouter( + [ + { + children: [ + { + element: , + index: true, + }, + { + element: , + path: '/about', + }, + { + element: , + path: '/blog', + }, + { + element: , + path: '/error', + }, + { + element: , + path: '*', + }, + ], + element: , + errorElement: , + path: '/', + }, + ], + { basename: import.meta.env.DEV ? '/' : '/gio/' } +); function App() { return ( diff --git a/vite.config.ts b/vite.config.ts index 98d78a3..590085b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,6 +2,19 @@ import react from '@vitejs/plugin-react'; import { defineConfig } from 'vite'; // https://vitejs.dev/config/ -export default defineConfig({ - plugins: [react({ jsxImportSource: '@emotion/react' })], +// export default defineConfig({ +// plugins: [react({ jsxImportSource: '@emotion/react' })], +// }); + +export default defineConfig(({ command }) => { + const config = { + base: '/', + plugins: [react({ jsxImportSource: '@emotion/react' })], + }; + + if (command !== 'serve') { + config.base = '/gio/'; + } + + return config; });