Unverified Commit 7472cefb authored by Jiachi Liu's avatar Jiachi Liu Committed by GitHub

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
parent 65fce8aa
---
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.
...@@ -1365,14 +1365,6 @@ export default async function build( ...@@ -1365,14 +1365,6 @@ export default async function build(
) )
nextBuildSpan.setAttribute('use-build-worker', String(useBuildWorker)) 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 ( if (
!useBuildWorker && !useBuildWorker &&
(runServerAndEdgeInParallel || collectServerBuildTracesInParallel) (runServerAndEdgeInParallel || collectServerBuildTracesInParallel)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment