mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-06 15:15:34 -06:00
Disable TanStackRouterDevtools in production, add Wakatime repository badge
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
# linkpulse
|
# linkpulse
|
||||||
|
|
||||||
|
[](https://wakatime.com/badge/github/Xevion/linkpulse)
|
||||||
|
|
||||||
A project for monitoring websites, built with FastAPI and React.
|
A project for monitoring websites, built with FastAPI and React.
|
||||||
|
|
||||||
## Structure
|
## Structure
|
||||||
|
|||||||
@@ -1,11 +1,25 @@
|
|||||||
import { createRootRoute, Outlet } from "@tanstack/react-router";
|
import { createRootRoute, Outlet } from "@tanstack/react-router";
|
||||||
import { TanStackRouterDevtools } from "@tanstack/router-devtools";
|
import { lazy, Suspense } from "react";
|
||||||
|
|
||||||
|
const TanStackRouterDevtools =
|
||||||
|
process.env.NODE_ENV === "production"
|
||||||
|
? () => null // Render nothing in production
|
||||||
|
: lazy(() =>
|
||||||
|
// Lazy load in development
|
||||||
|
import("@tanstack/router-devtools").then((res) => ({
|
||||||
|
default: res.TanStackRouterDevtools,
|
||||||
|
// For Embedded Mode
|
||||||
|
// default: res.TanStackRouterDevtoolsPanel
|
||||||
|
})),
|
||||||
|
);
|
||||||
|
|
||||||
export const Route = createRootRoute({
|
export const Route = createRootRoute({
|
||||||
component: () => (
|
component: () => (
|
||||||
<>
|
<>
|
||||||
<Outlet />
|
<Outlet />
|
||||||
|
<Suspense>
|
||||||
<TanStackRouterDevtools />
|
<TanStackRouterDevtools />
|
||||||
|
</Suspense>
|
||||||
</>
|
</>
|
||||||
),
|
),
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user