-
Notifications
You must be signed in to change notification settings - Fork 26.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into update-test-tsconfig
- Loading branch information
Showing
14 changed files
with
157 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import type { NextConfigComplete } from '../server/config-shared' | ||
|
||
export function hasCustomExportOutput(config: NextConfigComplete) { | ||
// In the past, a user had to run "next build" to generate | ||
// ".next" (or whatever the distDir) followed by "next export" | ||
// to generate "out" (or whatever the outDir). However, when | ||
// "output: export" is configured, "next build" does both steps. | ||
// So the user-configured distDir is actually the outDir. | ||
// We'll do some custom logic when meeting this condition. | ||
// e.g. | ||
// Will set config.distDir to .next to make sure the manifests | ||
// are still reading from temporary .next directory. | ||
return config.output === 'export' && config.distDir !== '.next' | ||
} |
Oops, something went wrong.