-
-
Notifications
You must be signed in to change notification settings - Fork 115
feat: resolve svelte
in exports
. prefer exports
to svelte
field
#459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This requires a changeset and it is a breaking change as a lot of existing libraries use it. Are you sure we don't need a replacement for custom resolving of .svelte files? How would other bundler plugins (rollup, webpack,?) handle this? Feels very large and important, so additional tests, documentation and communication to library authors are needed here. Ideally we would find a way to have legacy support for svelte field for a while and drop it only with the next svelte major. |
The main place this is documented is
I think what we could do instead is have |
I tried this before and it only works with I also think we should remove |
Do we need an RFC for that or does it "just work"? last time i looked at exports conditions it wasn't that great and iirc it still requires a flag to be used in node itself. How would it work for hybrid libraries that want to offer |
Just in case this wasn't clear: I completely agree with removing the "svelte" field, but really want to avoid breaking existing libs in the process. |
I might be misunderstanding, but that looks like two different named exports from an
Are you talking about something like this usecase that Rich mentioned? In that case, |
svelte
field
svelte
fieldsvelte
in exports
. prefer exports
to svelte
field
b7c07be
to
cc769df
Compare
cc769df
to
c4e2290
Compare
Closing for now. We should add a warning period first: #501 |
Closes #421
We shouldn't have our own resolving code path as it will fail to account for things like Vite's pre-bundling. If we really wanted to we could try to expose something from Vite and use if here. But I think that is not the best course of action as we're better off simply treating the
svelte
field as a boolean