File tree Expand file tree Collapse file tree 1 file changed +19
-3
lines changed
Expand file tree Collapse file tree 1 file changed +19
-3
lines changed Original file line number Diff line number Diff line change @@ -6,14 +6,30 @@ import {
66 Scripts ,
77 createRootRoute ,
88} from "@tanstack/react-router" ;
9- import type { ReactNode } from "react" ;
9+ import { type ReactNode , lazy } from "react" ;
1010import { Toaster } from "sonner" ;
1111import clerkCss from "../clerk.css?url" ;
1212import globalCss from "../globals.css?url" ;
13- import { TanStackRouterDevtools } from "@tanstack/router-devtools" ;
14- import { ReactQueryDevtools } from "@tanstack/react-query-devtools" ;
1513import { QueryClient , QueryClientProvider } from "@tanstack/react-query" ;
1614
15+ const TanStackRouterDevtools =
16+ process . env . NODE_ENV === "production"
17+ ? ( ) => null
18+ : lazy ( ( ) =>
19+ import ( "@tanstack/router-devtools" ) . then ( ( res ) => ( {
20+ default : res . TanStackRouterDevtools ,
21+ } ) )
22+ ) ;
23+
24+ const ReactQueryDevtools =
25+ process . env . NODE_ENV === "production"
26+ ? ( ) => null
27+ : lazy ( ( ) =>
28+ import ( "@tanstack/react-query-devtools" ) . then ( ( res ) => ( {
29+ default : res . ReactQueryDevtools ,
30+ } ) )
31+ ) ;
32+
1733export const Route = createRootRoute ( {
1834 head : ( ) => ( {
1935 meta : [
You can’t perform that action at this time.
0 commit comments