fix(vite): conditional exports can't be active when key is browser (#18012)#18016
fix(vite): conditional exports can't be active when key is browser (#18012)#18016NWYLZW wants to merge 5 commits intovitejs:mainfrom
Conversation
|
|
|
@NWYLZW Would you elaborate your usecase? Are you testing a library using Vitest for browser on Node without any shims like JSDOM? I think this is related to #9860. |
I don't need
The scenario is somewhat similar to what was mentioned in #9860, but the way it is handled causes |
# Conflicts: # packages/vite/src/node/plugins/resolve.ts
|
Hey, I noticed that the current I still firmly believe that if a user explicitly declares the corresponding conditional, we should respect their configuration. They shouldn't have to configure another option for this to work. If needed, I can also add related unit tests. |
|
There are some issues with the unit tests, but it seems that I did not introduce them. |
|
Closing as this is now possible since #18395 |
Description
#18012 (comment)
Based on my debugging results, the handling here seems a bit too tightly coupled with SSR. For other users encountering this issue, you can try setting the
ssrTargetparameter to 'webworker'. However, I believe this area should take into account that the user has already actively declared the conditional.