fix(vite): ensure cache is created correctly for separate vite and vitest config files #22244 #22618
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.
Current Behavior
When both a Vite config file and Vitest config file exist for a single project, the hash that is calculated when creating the targets is the same, and therefore one operation overwrites the other.
This leads to invalid store of targets available for the project.
Expected Behavior
Both sets of targets should produce a different hash allowing for a separate cache for each which gets merged correctly when targets are inferred.
Related Issue(s)
Fixes #22244