fix: respect mainFields when resolving browser/module field (fixes #8659)#10071
fix: respect mainFields when resolving browser/module field (fixes #8659)#10071patak-cat merged 4 commits intovitejs:mainfrom
mainFields when resolving browser/module field (fixes #8659)#10071Conversation
|
I would prefer to directly wait for Vite 4 and fix this instead of adding the temporal |
|
I think indeed the current behavior is a kinda flaw and the fix makes a lot of sense. As for the shipping, I think we could have the workaround (maybe via an option instead of a magic |
I was also thinking about some JFI: there is also #9860 PR that fixes similar problem. |
|
Thanks for the feedback. @sapphi-red what do you think about renaming to |
|
Yeah, sounds good to me. I've update the PR 👍 |
Description
Because
resolve.mainFields's default value does not include'browser', I added a special!browservalue to avoid a breaking change.https://vitejs.dev/config/shared-options.html#resolve-mainfields
In Vite 4, I think we could change the default value to
['browser', 'module', 'jsnext:main', 'jsnext'].fixes #8659
Additional context
What is the purpose of this pull request?
Before submitting the PR, please make sure you do the following
fixes #123).