Skip to content

Commit 1a481c5

Browse files
committed
refactor(@angular/build): support directly merging bundler results
The bundler context class now has a static helper method to support merging bundler results outside of a specific bundle action. This will be used in the future to support more complex bundling hierarchies.
1 parent db1a6ae commit 1a481c5

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

packages/angular/build/src/tools/esbuild/bundler-context.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,13 @@ export class BundlerContext {
113113
}),
114114
);
115115

116+
return BundlerContext.mergeResults(individualResults);
117+
}
118+
119+
static mergeResults(results: BundleContextResult[]): BundleContextResult {
116120
// Return directly if only one result
117-
if (individualResults.length === 1) {
118-
return individualResults[0];
121+
if (results.length === 1) {
122+
return results[0];
119123
}
120124

121125
let errors: Message[] | undefined;
@@ -127,7 +131,7 @@ export class BundlerContext {
127131

128132
const outputFiles = [];
129133
let externalConfiguration;
130-
for (const result of individualResults) {
134+
for (const result of results) {
131135
warnings.push(...result.warnings);
132136
if (result.errors) {
133137
errors ??= [];

0 commit comments

Comments
 (0)