fix(@angular/build): fix setup files duplicate modules#31791
fix(@angular/build): fix setup files duplicate modules#31791yjaaidi wants to merge 2 commits intoangular:mainfrom
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. Closes angular#31732
|
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. | ||
| */ | ||
| export function getSetupEntrypoints( |
There was a problem hiding this comment.
I'm not happy with this.
I would rather have a single getEntrypoints 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.
This produces bundles named setup-test-setup which is weird.
An empty string would be better but collisions could happen with a setup file called spec-setup... or something.
|
Closing as this original issue has been solved via #32428 |
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