File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,10 @@ npm install remix-development-tools -D
4747// We'll lazy load RemixDevTools to ensure it doesn't contribute to production bundle size
4848+ import { lazy } from "react";
4949+ import rdtStylesheet from "remix-development-tools/stylesheet.css";
50- + const RemixDevTools = lazy(() => import("remix-development-tools");
50+ + const RemixDevTools =
51+ + process.env.NODE_ENV === "development"
52+ + ? React.lazy(() => import("remix-development-tools").then(({ RemixDevTools }) => ({ default: RemixDevTools })))
53+ + : undefined;
5154
5255+ export const links: LinksFunction = () => [
5356+ ...(rdtStylesheet && process.env.NODE_ENV === "development" ? [{ rel: "stylesheet", href: rdtStylesheet }] : []),
@@ -70,7 +73,7 @@ export default function App() {
7073 <ScrollRestoration />
7174 <Scripts />
7275 <LiveReload />
73- + {process.env.NODE_ENV === "development" && <RemixDevTools />}
76+ + {RemixDevTools && <RemixDevTools />}
7477 </body>
7578 </html>
7679 );
You can’t perform that action at this time.
0 commit comments