Skip to content

Commit

Permalink
routes
Browse files Browse the repository at this point in the history
  • Loading branch information
avo committed Oct 27, 2024
1 parent 98a4e90 commit 545dfc1
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 31 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,6 @@
"typescript-eslint": "^8.10.0",
"vite": "^5.4.9"
},
"homepage": "https://avo.github.io/",
"packageManager": "[email protected]"
}
61 changes: 32 additions & 29 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,35 +9,38 @@ import { baseStyle } from './styles/Base';
import { elementStyle } from './styles/Element';
import { themeStyle } from './styles/Theme';

const router = createBrowserRouter([
{
children: [
{
element: <About />,
index: true,
},
{
element: <About />,
path: '/about',
},
{
element: <Newness />,
path: '/blog',
},
{
element: <Error />,
path: '/error',
},
{
element: <Unknown />,
path: '*',
},
],
element: <Root />,
errorElement: <Error />,
path: '/',
},
]);
const router = createBrowserRouter(
[
{
children: [
{
element: <About />,
index: true,
},
{
element: <About />,
path: '/about',
},
{
element: <Newness />,
path: '/blog',
},
{
element: <Error />,
path: '/error',
},
{
element: <Unknown />,
path: '*',
},
],
element: <Root />,
errorElement: <Error />,
path: '/',
},
],
{ basename: import.meta.env.DEV ? '/' : '/gio/' }
);

function App() {
return (
Expand Down
17 changes: 15 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});

0 comments on commit 545dfc1

Please sign in to comment.