's'
This commit is contained in:
@@ -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;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user