- Notifications
You must be signed in to change notification settings - Fork11.9k
fix(@angular/build): fix setup files duplicate modules#31791
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
Conversation
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates.Module duplicates can break many things such as dependency injection.Closesangular#31732
yjaaidi commentedNov 13, 2025
I tried to keep this the less intrusive possible but I wonder if the right fix wouldn't involve changes to |
| *@param options Configuration options for generating entry points. | ||
| *@returns A map where keys are the generated unique bundle names and values are the original file paths. | ||
| */ | ||
| exportfunctiongetSetupEntrypoints( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm not happy with this.
I would rather have a singlegetEntrypoints that returns both test files and setup files then we would have to forward the setup file names to the executor somehow.
| projectSourceRoot, | ||
| workspaceRoot, | ||
| removeTestExtension, | ||
| prefix:'setup', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
This produces bundles namedsetup-test-setup which is weird.
An empty string would be better but collisions could happen with a setup file calledspec-setup... or something.
Uh oh!
There was an error while loading.Please reload this page.
This includes setup files in the initial build and avoids lazy discovery and thus module duplicates.
Module duplicates can break many things such as dependency injection.
setupFilesdirectly provided to the builder.Handling
setupFilesfrom the Vitest config requires substantial additional effort.PR Checklist
Please check to confirm your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number:#31732
What is the new behavior?
Does this PR introduce a breaking change?
Other information