Files
cozsweet-frontend-nextjs/next.config.ts
T

44 lines
1.3 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import type { NextConfig } from "next";
import { withSerwist } from "@serwist/turbopack";
/**
* Next.js 16 临时绕过 `/_global-error` prerender 的 workStore bug
* 标记根 layout 不参与静态预渲染(global-error 会在请求时渲染)
* https://nextjs.org/docs/app/api-reference/file-conventions/route-segment-config
*
* 默认部署模型:`.next/` + `public/` + `next start`(或 Vercel 零配置)
* - `pnpm build` 产出 .next/(含 build manifest / chunks / 路由表 / 静态预渲染)
* - 脚本侧:scripts/deploy/_deploy_lib.sh 同步 .next/ + public/
* - 服务器启动:`cd <path> && next start -H 0.0.0.0 -p 3000`
* 或用 PM2`pm2 start "next start" --name cozsweet`
*/
const nextConfig: NextConfig = {
experimental: {
// 关闭静态优化以规避 16.2.7 global-error prerender bug
staticGenerationRetryCount: 0,
},
images: {
remotePatterns: [
{
protocol: "https",
hostname: "platform-lookaside.fbsbx.com",
},
{
protocol: "https",
hostname: "graph.facebook.com",
},
{
protocol: "https",
hostname: "**.supabase.co",
pathname: "/storage/v1/object/public/**",
},
{
protocol: "https",
hostname: "free.picui.cn",
},
],
},
};
export default withSerwist(nextConfig);