You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(resolve): prefer exports condition over svelte field (#747)
* refactor(resolve): prefer exports condition over svelte field
* chore: add changeset
* refactor: use vite mainFields resolve instead of our custom implementation, log packages while scanning deps instead
Copy file name to clipboardExpand all lines: docs/faq.md
+3-4
Original file line number
Diff line number
Diff line change
@@ -209,13 +209,12 @@ module.exports = {
209
209
210
210
<!-- the following header generates an anchor that is used in logging, do not modify!-->
211
211
212
-
### conflicts in svelte resolve
212
+
### missing exports condition
213
213
214
214
| If you see a warning logged for this when using a Svelte library, please tell the library maintainers.
215
215
216
-
In the past, Svelte recommended using the custom `svelte` field in `package.json` to allow libraries to point at `.svelte` source files.
217
-
This field requires a custom implementation to resolve, so you have to use a bundler plugin and this plugin needs to implement resolving.
218
-
Since then, Node has added support for [conditional exports](https://nodejs.org/api/packages.html#conditional-exports), which have more generic support in bundlers and Node itself. So to increase the compatibility with the wider ecosystem and reduce the implementation needs for current and future bundler plugins, it is recommended that packages use the `svelte` exports condition.
216
+
Using the `svelte` field in `package.json` to point at `.svelte` source files is **deprecated** and you must use a `svelte`[export condition](https://nodejs.org/api/packages.html#conditional-exports).
217
+
vite-plugin-svelte 3 still resolves it as a fallback, but in a future major release this is going to be removed and without exports condition resolving the library is going to fail.
`WARNING: The following packages use a svelte resolve configuration in package.json that has conflicting results and is going to cause problems future.\n\n${[
248
-
...packagesWithResolveWarnings
249
-
].join('\n')}\n\nPlease see ${FAQ_LINK_CONFLICTS_IN_SVELTE_RESOLVE} for details.`
0 commit comments