-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
fix: improve setup of default export #8497
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
Instead of "both", which doesn't make sense at that point.
Co-authored-by: Ben McCann <[email protected]>
- upgrade to TypeScript 5 - upgrade @ampproject/remapping - remove obsolete workarounds --------- Co-authored-by: Simon Holthausen <[email protected]>
bump to rollup 3. Includes reworking the "treat those imports as external" a bit so that Rollup builds correctly but doesn't bundle some of the (now relative) imports --------- Co-authored-by: Simon Holthausen <[email protected]>
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@benmccann is attempting to deploy a commit to the Svelte Team on Vercel. A member of the Team first needs to authorize it. |
I seem to recall there being some discussion where we decided the |
To my knowledge this does work as intended, treeshaking imports only used in onMount during ssr. latest vite does not need the custom resolve for it in v-p-s anymore, but early vite 4 versions did, so we cant remove it without breaking. please keep the separate ssr export as is for now. |
I think we can remove the separate ssr export, that was because Vite isn't resolving the node condition correctly before, but it's now fixed. Since they can bump Vite to fix it, I don't think that should block us from removing it. |
Oh, i didn't realize the browser condition above, thanks for pointing it out @bluwy This would be a very breaking change for everything not understanding the browser exports condition. They got index.js before and now would get ssr.js |
I vote for keeping the |
What falls into the category of understanding |
Any bundler not setting the browser condition explicitly, maybe unpkg or other package cdns? unpkg/unpkg#325 In principle I do agree with simplifying the conditions, and using "node" as synonymous for SSR isn't great. Another question would be if rollup and webpack configs from users need to be updated to enable the browser condition, i'm not sure it is set by default there. |
I think it's on by default for webpack: It's not for Rollup, but we suggest it in the |
|
this branch is trashed. closing in favor of #8516 |
closes #8088
@dominikg @bluwy do we still need to export
ssr
as well? Why doesvite-plugin-svelte
need the custom logic below? Shouldn't Vite resolve to the ssr or non-ssr version as appropriate using the default export?https://github.com/sveltejs/vite-plugin-svelte/blob/f8d2bab37e875f654202baeb89d85af9c7501562/packages/vite-plugin-svelte/src/index.ts#L138