This commit is contained in:
eric
2026-03-24 05:13:49 -05:00
parent 6c0651e1be
commit 2636c5ca6b
309 changed files with 12355 additions and 3 deletions

View File

@@ -1,12 +1,19 @@
const { getBuildProfile } = require("./scripts/build-resource-profile.cjs");
/** @type {import('next').NextConfig} */
const nextConfig = {
// Docker 部署支持
// output: 'standalone',
// 低配 VPS降低 webpack 并行度,减少构建峰值内存(构建会变慢)
// 生产构建parallelism 由 scripts/next-build.cjs 注入 NAVSPHERE_WEBPACK_PARALLELISM直接 next build 则按机器自动算
webpack: (config, { dev }) => {
if (!dev) {
config.parallelism = 1;
const fromEnv = process.env.NAVSPHERE_WEBPACK_PARALLELISM;
const n = fromEnv ? parseInt(fromEnv, 10) : NaN;
config.parallelism =
Number.isFinite(n) && n > 0
? n
: getBuildProfile().parallelism;
}
return config;
},