fix(resolve): fix resolve cache key for external conditions#18332
fix(resolve): fix resolve cache key for external conditions#18332sapphi-red merged 2 commits intovitejs:mainfrom
Conversation
|
|
|
I guess we should give users a way to remove the default conditions or change the default conditions to be an empty array, now that with the environment api, people would now might want to remove both |
|
Yeah, I agree there should be a better way to organize Maybe it would interesting to bring back proper |
patak-cat
left a comment
There was a problem hiding this comment.
I agree with both here. In other cases, we have the opportunity to change options without a breaking change (with all the options we moved from server to dev), but here I think we are forced to keep resolve.conditions as is. I think we could merge this PR, and then try to replace both options with a better API later on.
|
OK, let's merge this PR 👍 |
Description
I realized resolve cache still conflicts for ssr external resolution as it uses
conditions: []andoverrideConditionsinstead 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
reactin bothssrandrscenvironments. I found the resolve bug still exists in hi-ogawa/vite-environment-examples#131 when testing pkg-pr-new from main.