fix(resolve): fix resolve cache key for external conditions #18332
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.
Description
I realized resolve cache still conflicts for ssr external resolution as it uses
conditions: []
andoverrideConditions
instead internally. To fix this, I'm adding one more to cache key for now.vite/packages/vite/src/node/ssr/fetchModule.ts
Lines 47 to 60 in f85aea2
My use case / experiment is to externalize
react
in bothssr
andrsc
environments. I found the resolve bug still exists in hi-ogawa/vite-environment-examples#131 when testing pkg-pr-new from main.