mirror of
https://github.com/Xevion/linkpulse.git
synced 2025-12-05 23:15:26 -06:00
Disable TanStackRouterDevtools in production, add Wakatime repository badge
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
# linkpulse
|
||||
|
||||
[](https://wakatime.com/badge/github/Xevion/linkpulse)
|
||||
|
||||
A project for monitoring websites, built with FastAPI and React.
|
||||
|
||||
## Structure
|
||||
|
||||
@@ -1,11 +1,25 @@
|
||||
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({
|
||||
component: () => (
|
||||
<>
|
||||
<Outlet />
|
||||
<TanStackRouterDevtools />
|
||||
<Suspense>
|
||||
<TanStackRouterDevtools />
|
||||
</Suspense>
|
||||
</>
|
||||
),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user