feat(resolve)!: remove resolve.browserField#14733
Conversation
|
|
| const resolveOptions: NodeImportResolveOptions = { | ||
| mainFields: ['main'], | ||
| browserField: true, |
There was a problem hiding this comment.
I'm not sure if this was a mistake, the browserField was used in SSR resolving.
There was a problem hiding this comment.
Before #10071, Vite used browser field even with ssrModuleLoader and I wanted to preserve that behavior to avoid a breaking change. I think this change makes sense.
|
Looks good to me. I think it would be good to add a warning if the user has |
sapphi-red
left a comment
There was a problem hiding this comment.
Thanks! I forgot about this thing 😅
| const resolveOptions: NodeImportResolveOptions = { | ||
| mainFields: ['main'], | ||
| browserField: true, |
There was a problem hiding this comment.
Before #10071, Vite used browser field even with ssrModuleLoader and I wanted to preserve that behavior to avoid a breaking change. I think this change makes sense.
|
/ecosystem-ci run |
|
📝 Ran ecosystem CI on
|
Description
resolve.browserFieldwas introduced deprecated by default in #10071. The plan was to updateresolve.mainFieldsto['browser', 'module', 'jsnext:main', 'jsnext']which I did in this PR.This particular change can be breaking for tooling as some tools (e.g.
vite-plugin-svelte) wants to add additionalmainFields, and the only way to not remove the existing['module', 'jsnext:main', 'jsnext']was to hardcode it:https://github.com/sveltejs/vite-plugin-svelte/blob/b4b4fddf4d226856aa0f27fa4f32621dfb2938bf/packages/vite-plugin-svelte/src/utils/constants.js#L1
https://github.com/sveltejs/vite-plugin-svelte/blob/b4b4fddf4d226856aa0f27fa4f32621dfb2938bf/packages/vite-plugin-svelte/src/utils/options.js#L359-L362
Additional context
Noticed this while working on #14723
What is the purpose of this pull request?