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