Skip to content

Commit

Permalink
fix: always use base
Browse files Browse the repository at this point in the history
  • Loading branch information
cmgriffing committed Jan 17, 2024
1 parent c88cfcb commit 08f861e
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 22 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build --base=/orderly/",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"models": "tsx scripts/get-models.ts",
Expand Down
47 changes: 26 additions & 21 deletions src/router.tsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
import { createBrowserRouter } from "react-router-dom";
import { createHashRouter } from "react-router-dom";
import { App } from "./App";
import { Demo } from "./Demo";
import { Home } from "./routes/Home";
import { Chapter } from "./routes/Chapter";
import { Snippet } from "./routes/Snippet";

export const router = createBrowserRouter([
export const router = createHashRouter(
[
{
path: "/",
element: <App />,
children: [
{
path: "",
element: <Home />,
},
{
path: "books/:bookId/chapters/:chapterId",
element: <Chapter />,
children: [{ path: "snippets/:snippetId", element: <Snippet /> }],
},
],
},
{
path: "/demo",
element: <Demo />,
},
],
{
path: "/",
element: <App />,
children: [
{
path: "",
element: <Home />,
},
{
path: "books/:bookId/chapters/:chapterId",
element: <Chapter />,
children: [{ path: "snippets/:snippetId", element: <Snippet /> }],
},
],
},
{
path: "/demo",
element: <Demo />,
},
]);
basename: "/orderly",
}
);
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import react from "@vitejs/plugin-react-swc";

// https://vitejs.dev/config/
export default defineConfig({
base: "/orderly/",
optimizeDeps: {
exclude: ["sqlocal"],
},
Expand Down

0 comments on commit 08f861e

Please sign in to comment.