build: migrate dev server to webpack
https://github.com/vercel/next.js/issues/78069
This commit is contained in:
parent
41fb8bbb51
commit
d41180b42b
4 changed files with 24 additions and 7 deletions
|
|
@ -28,9 +28,12 @@ This is production ready setup for Convex and Next SaaS.
|
|||
First, run the development server:
|
||||
|
||||
```bash
|
||||
pnpm dev
|
||||
pnpm dev --webpack
|
||||
```
|
||||
|
||||
> [!NOTE]
|
||||
> As of Next.js@16.2.1 turbopack is broken ant it spikes CPU usage by 900% and 8-9GiB of RAM usage, thus why we use webpack. Wait for 16.3.0 to migrate to turbopack
|
||||
|
||||
### Convex
|
||||
|
||||
[Source of truth](https://github.com/get-convex/convex-backend/blob/main/self-hosted/README.md)
|
||||
|
|
|
|||
|
|
@ -14,8 +14,8 @@ export default function RootLayout({
|
|||
children: React.ReactNode;
|
||||
}>) {
|
||||
return (
|
||||
<html lang="en" className="h-full antialiased">
|
||||
<body className="min-h-full flex flex-col" suppressHydrationWarning>
|
||||
<html lang="en" className="h-full antialiased" suppressHydrationWarning>
|
||||
<body className="min-h-full flex flex-col">
|
||||
<NextIntlClientProvider>
|
||||
<ThemeProvider>{children}</ThemeProvider>
|
||||
</NextIntlClientProvider>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,28 @@
|
|||
"use client";
|
||||
import { useTheme } from "next-themes";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export const ThemeChanger = () => {
|
||||
const { theme, setTheme } = useTheme();
|
||||
const [mounted, setMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!mounted) {
|
||||
return <p>Loading theme...</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
The current theme is: {theme}
|
||||
<button onClick={() => setTheme("light")}>Light Mode</button>
|
||||
<button onClick={() => setTheme("dark")}>Dark Mode</button>
|
||||
<p>The current theme is: {theme}</p>
|
||||
<button type="button" onClick={() => setTheme("light")}>
|
||||
Light Mode
|
||||
</button>
|
||||
<button type="button" onClick={() => setTheme("dark")}>
|
||||
Dark Mode
|
||||
</button>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -12,4 +12,4 @@ windows:
|
|||
- nvim ~/vaults/mentat/<project-name>
|
||||
- frontend:
|
||||
panes:
|
||||
- pnpm dev
|
||||
- pnpm dev --webpack
|
||||
|
|
|
|||
Loading…
Reference in a new issue