perf(vite): add dynamic imports
This commit is contained in:
parent
78e15f6218
commit
85921a0a08
29 changed files with 470 additions and 326 deletions
|
|
@ -17,6 +17,7 @@
|
|||
"@tauri-apps/api": "^2.11.1",
|
||||
"@tensamin/cache": "workspace:*",
|
||||
"@tensamin/hotkeys": "workspace:*",
|
||||
"@tensamin/markdown": "workspace:*",
|
||||
"@tensamin/mtp": "workspace:*",
|
||||
"@tensamin/shared": "workspace:*",
|
||||
"@tensamin/storage": "workspace:*",
|
||||
|
|
|
|||
|
|
@ -1,29 +1,20 @@
|
|||
import Accessibility from "./pages/accessibility";
|
||||
import Cache from "./pages/cache";
|
||||
import Call from "./pages/call";
|
||||
import Chat from "./pages/chat";
|
||||
import Index from "./pages/index";
|
||||
import Licenses from "./pages/licenses";
|
||||
import Profile from "./pages/profile";
|
||||
import Security from "./pages/security";
|
||||
import Theme from "./pages/theme";
|
||||
import Hotkeys from "./pages/hotkeys";
|
||||
import { lazy } from "react";
|
||||
import { settingsNavigation } from "./navigation";
|
||||
|
||||
const pageComponents = {
|
||||
profile: Profile,
|
||||
security: Security,
|
||||
chat: Chat,
|
||||
call: Call,
|
||||
cache: Cache,
|
||||
theme: Theme,
|
||||
accessibility: Accessibility,
|
||||
hotkeys: Hotkeys,
|
||||
licenses: Licenses,
|
||||
profile: lazy(() => import("./pages/profile")),
|
||||
security: lazy(() => import("./pages/security")),
|
||||
chat: lazy(() => import("./pages/chat")),
|
||||
call: lazy(() => import("./pages/call")),
|
||||
cache: lazy(() => import("./pages/cache")),
|
||||
theme: lazy(() => import("./pages/theme")),
|
||||
accessibility: lazy(() => import("./pages/accessibility")),
|
||||
hotkeys: lazy(() => import("./pages/hotkeys")),
|
||||
licenses: lazy(() => import("./pages/licenses")),
|
||||
} as const;
|
||||
|
||||
export const settingsPages = [
|
||||
{ path: "/", component: Index },
|
||||
{ path: "/", component: lazy(() => import("./pages/index")) },
|
||||
...settingsNavigation.map((page) => ({
|
||||
...page,
|
||||
component: pageComponents[page.path],
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
import { Input as MDInput } from "@methanium/ui/markdown";
|
||||
import MDInput from "@tensamin/markdown/input";
|
||||
import { useMTP } from "@tensamin/mtp";
|
||||
import { mtp } from "@tensamin/shared/data";
|
||||
import { useStorage } from "@tensamin/storage/context";
|
||||
|
|
|
|||
Loading…
Reference in a new issue