Skip to content

Commit

Permalink
fix(@angular-devkit/build-angular): avoid binary content in architect…
Browse files Browse the repository at this point in the history
… results with browser-esbuild

The builder system (architect) currently attempts to treat all results as JSON and
attempts to validate the object with a JSON schema validator. This can lead to slow
build completion (even after the actual build is fully complete) or crashes if the
size and/or quantity of output files is large. Architect only requires a `success`
property so that is all that will be passed here if the infrastructure settings have
not been explicitly set to avoid writes. Writing is only disabled when used directly
by the dev server which bypasses the architect behavior.
  • Loading branch information
clydin authored and alan-agius4 committed Oct 26, 2023
1 parent 82f8550 commit cdea518
Showing 1 changed file with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,16 @@ export async function* buildEsbuildBrowser(
await writeResultFiles(result.outputFiles, result.assetFiles, fullOutputPath);
}

yield result;
// The builder system (architect) currently attempts to treat all results as JSON and
// attempts to validate the object with a JSON schema validator. This can lead to slow
// build completion (even after the actual build is fully complete) or crashes if the
// size and/or quantity of output files is large. Architect only requires a `success`
// property so that is all that will be passed here if the infrastructure settings have
// not been explicitly set to avoid writes. Writing is only disabled when used directly
// by the dev server which bypasses the architect behavior.
const builderResult =
infrastructureSettings?.write === false ? result : { success: result.success };
yield builderResult;
}
}

Expand Down

0 comments on commit cdea518

Please sign in to comment.