perf: force-static

This commit is contained in:
hamster1963 2024-09-30 23:01:07 +08:00
parent 4671ee3aaf
commit 99ead50d1c
2 changed files with 16 additions and 3 deletions

View File

@ -35,6 +35,8 @@ export const viewport: Viewport = {
userScalable: false,
};
export const dynamic = "force-static";
export default function LocaleLayout({
children,
params: { locale },
@ -45,9 +47,9 @@ export default function LocaleLayout({
const messages = useMessages();
return (
<html lang={locale} suppressHydrationWarning>
<head>
{/* <head>
<PublicEnvScript />
</head>
</head> */}
<body
className={cn(
"min-h-screen bg-background font-sans antialiased",

View File

@ -1,3 +1,9 @@
import withBundleAnalyzer from "@next/bundle-analyzer";
const bundleAnalyzer = withBundleAnalyzer({
enabled: process.env.ANALYZE === "true",
});
import createNextIntlPlugin from "next-intl/plugin";
const withNextIntl = createNextIntlPlugin();
import withPWAInit from "@ducanh2912/next-pwa";
@ -16,5 +22,10 @@ const withPWA = withPWAInit({
const nextConfig = {
output: "standalone",
reactStrictMode: true,
logging: {
fetches: {
fullUrl: true,
},
},
};
export default withPWA(withNextIntl(nextConfig));
export default bundleAnalyzer(withPWA(withNextIntl(nextConfig)));