's'
This commit is contained in:
@@ -1,8 +1,22 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
/** 由 scripts/build-safe.cjs 设置;在 VPS 上也可手动 export 后执行 pnpm build */
|
||||
const lowMemBuild = process.env.NEXT_BUILD_LOW_MEM === "1";
|
||||
|
||||
const nextConfig: NextConfig = {
|
||||
experimental: {
|
||||
serverActions: { bodySizeLimit: "25mb" },
|
||||
...(lowMemBuild
|
||||
? {
|
||||
// 限制并行与预渲染并发,降低峰值内存(Next 16 默认 Turbopack 构建)
|
||||
cpus: 1,
|
||||
turbopackMemoryLimit: 1536 * 1024 * 1024,
|
||||
staticGenerationMaxConcurrency: 1,
|
||||
webpackMemoryOptimizations: true,
|
||||
parallelServerCompiles: false,
|
||||
parallelServerBuildTraces: false,
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
async headers() {
|
||||
const noCacheHeaders = [
|
||||
|
||||
Reference in New Issue
Block a user