Unverified Commit 5a5f0d00 authored by Tim Neutkens's avatar Tim Neutkens Committed by GitHub

Enable serial build by default (#25642)

parent 9c3780fb
......@@ -543,33 +543,25 @@ export default async function build(
const webpackBuildStart = process.hrtime()
let result: CompilerResult = { warnings: [], errors: [] }
// We run client and server compilation separately when configured for
// memory constraint and for serverless to be able to load manifests
// produced in the client build
if (isLikeServerless || config.experimental.serialWebpackBuild) {
await nextBuildSpan
.traceChild('run-webpack-compiler')
.traceAsyncFn(async () => {
const clientResult = await runCompiler(clientConfig)
// Fail build if clientResult contains errors
if (clientResult.errors.length > 0) {
result = {
warnings: [...clientResult.warnings],
errors: [...clientResult.errors],
}
} else {
const serverResult = await runCompiler(configs[1])
result = {
warnings: [...clientResult.warnings, ...serverResult.warnings],
errors: [...clientResult.errors, ...serverResult.errors],
}
// We run client and server compilation separately to optimize for memory usage
await nextBuildSpan
.traceChild('run-webpack-compiler')
.traceAsyncFn(async () => {
const clientResult = await runCompiler(clientConfig)
// Fail build if clientResult contains errors
if (clientResult.errors.length > 0) {
result = {
warnings: [...clientResult.warnings],
errors: [...clientResult.errors],
}
})
} else {
result = await nextBuildSpan
.traceChild('run-webpack-compiler')
.traceAsyncFn(() => runCompiler(configs))
}
} else {
const serverResult = await runCompiler(configs[1])
result = {
warnings: [...clientResult.warnings, ...serverResult.warnings],
errors: [...clientResult.errors, ...serverResult.errors],
}
}
})
const webpackBuildEnd = process.hrtime(webpackBuildStart)
if (buildSpinner) {
......
......@@ -50,7 +50,6 @@ export type NextConfig = { [key: string]: any } & {
scriptLoader?: boolean
stats?: boolean
externalDir?: boolean
serialWebpackBuild?: boolean
conformance?: boolean
amp?: {
optimizer?: any
......@@ -115,7 +114,6 @@ export const defaultConfig: NextConfig = {
scriptLoader: false,
stats: false,
externalDir: false,
serialWebpackBuild: false,
turboMode: false,
eslint: false,
reactRoot: Number(process.env.NEXT_PRIVATE_REACT_ROOT) > 0,
......
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