Remove the warning for build worker when custom webpack present (#60820)

Drop the warning of build worker due to the common usage of custom
webpack

Closes NEXT-2148
This commit is contained in:
Jiachi Liu 2024-01-18 16:06:08 +01:00 committed by GitHub
parent 65fce8aa6b
commit 7472cefb42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 0 additions and 23 deletions

View file

@ -1,15 +0,0 @@
---
title: Webpack Build Worker automatic opt-out
---
## Webpack Build Worker Opt-out
#### Why This Error Occurred
The Next.js config contains custom webpack configuration, as a result, the webpack build worker optimization was disabled.
The webpack build worker optimization helps alleviate memory stress during builds and reduce out-of-memory errors although some custom configurations may not be compatible.
#### Possible Ways to Fix It
You can force enable the option by setting `config.experimental.webpackBuildWorker: true` in the config.

View file

@ -1365,14 +1365,6 @@ export default async function build(
)
nextBuildSpan.setAttribute('use-build-worker', String(useBuildWorker))
if (
config.webpack &&
config.experimental.webpackBuildWorker === undefined
) {
Log.warn(
'Custom webpack configuration is detected. When using a custom webpack configuration, the Webpack build worker is disabled by default. To force enable it, set the "experimental.webpackBuildWorker" option to "true". Read more: https://nextjs.org/docs/messages/webpack-build-worker-opt-out'
)
}
if (
!useBuildWorker &&
(runServerAndEdgeInParallel || collectServerBuildTracesInParallel)