fix(@angular/build): preserve duplicate bundle filenames across output file types - #33936
Merged
Merged
Conversation
clydin
force-pushed
the
fix-duplicate-output-files
branch
2 times, most recently
from
August 27, 2026 00:11
1c9af29 to
ab5ba26
Compare
clydin
marked this pull request as ready for review
August 27, 2026 00:11
There was a problem hiding this comment.
Code Review
This pull request refactors the build output representation across various Angular builders, changing the files structure from a record/dictionary to an array of ResultFile objects. This simplifies file iteration and processing, and resolves potential path collisions by keying previous output info with both type and path. The review feedback suggests a performance optimization in build-action.ts to defer the creation of ResultFile objects, avoiding unnecessary allocations for unchanged files.
…t file types When building applications with SSR and Service Worker enabled, bundle outputs (such as CSS chunks produced from JS imports) can share the same relative path name across different `BuildOutputFileType`s (e.g. `BuildOutputFileType.Browser` and `BuildOutputFileType.ServerApplication`). Previously, build results stored output files in a Record keyed by file path, which caused server files to overwrite browser files of the same name and prevented them from being emitted to the browser output directory. The build `Result` interface now maintains `files` as an array (`ResultFile[]`), and rebuild tracking keys output files using a compound type and path key, ensuring all files are preserved and emitted correctly regardless of type. Closes angular#33922
clydin
force-pushed
the
fix-duplicate-output-files
branch
from
August 27, 2026 00:16
ab5ba26 to
2a7a2f7
Compare
alan-agius4
approved these changes
Aug 27, 2026
Collaborator
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When building applications with SSR and Service Worker enabled, bundle outputs (such as CSS chunks produced from JS imports) can share the same relative path name across different
BuildOutputFileTypes (e.g.BuildOutputFileType.BrowserandBuildOutputFileType.ServerApplication).Previously, build results stored output files in a Record keyed by file path, which caused server files to overwrite browser files of the same name and prevented them from being emitted to the browser output directory.
The build
Resultinterface now maintainsfilesas an array (ResultFile[]), and rebuild tracking keys output files using a compound type and path key, ensuring all files are preserved and emitted correctly regardless of type.Closes #33922