Use vite to detech production mode

This commit is contained in:
Arnaud 2024-08-30 18:10:18 +02:00
parent a9ec0c5156
commit cf3adb634a
No known key found for this signature in database
GPG Key ID: 69D6CE281FCAE663

View File

@ -1,17 +1,16 @@
import { createRootRoute, Outlet } from "@tanstack/react-router";
import React from "react";
const TanStackRouterDevtools =
process.env.NODE_ENV === "production"
? () => null // Render nothing in production
: React.lazy(() =>
// Lazy load in development
import("@tanstack/router-devtools").then((res) => ({
default: res.TanStackRouterDevtools,
// For Embedded Mode
// default: res.TanStackRouterDevtoolsPanel
}))
);
const TanStackRouterDevtools = import.meta.env.PROD
? () => null // Render nothing in production
: React.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: () => {