File tree Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Expand file tree Collapse file tree 2 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,6 @@ IS_PREVIEW_DEPLOY=false
24
24
# Note: always include `en` as it is the default lang of the site
25
25
BUILD_LOCALES =
26
26
27
- # If resource constraints are being hit during builds, change LIMIT_CPU to `true`
28
- # to limit the demand during build time
29
- LIMIT_CPU = false
27
+ # If resource constraints are being hit during builds, change LIMIT_CPUS to a
28
+ # fixed number of CPUs (e.g. 2) to limit the demand during build time
29
+ LIMIT_CPUS =
Original file line number Diff line number Diff line change @@ -2,18 +2,19 @@ const { PHASE_DEVELOPMENT_SERVER } = require("next/constants")
2
2
3
3
const { i18n } = require ( "./next-i18next.config" )
4
4
5
- const experimental =
6
- ( process . env . LIMIT_CPU || "" ) . toLowerCase ( ) === "true"
7
- ? {
8
- // This option could be enabled in the future when flagged as stable, to speed up builds
9
- // (see https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)
10
- // mdxRs: true,
11
-
12
- // Reduce the number of cpus and disable parallel threads in prod envs to consume less memory
13
- workerThreads : false ,
14
- cpus : 2 ,
15
- }
16
- : { }
5
+ const LIMIT_CPUS = Number ( process . env . LIMIT_CPUS || 2 )
6
+
7
+ const experimental = LIMIT_CPUS
8
+ ? {
9
+ // This option could be enabled in the future when flagged as stable, to speed up builds
10
+ // (see https://nextjs.org/docs/pages/building-your-application/configuring/mdx#using-the-rust-based-mdx-compiler-experimental)
11
+ // mdxRs: true,
12
+
13
+ // Reduce the number of cpus and disable parallel threads in prod envs to consume less memory
14
+ workerThreads : false ,
15
+ cpus : LIMIT_CPUS ,
16
+ }
17
+ : { }
17
18
18
19
/** @type {import('next').NextConfig } */
19
20
module . exports = ( phase , { defaultConfig } ) => {
You can’t perform that action at this time.
0 commit comments