feat: expose `'svelte/internal'` (#10987)

* feat: expose svelte/internal

* fix
pull/10983/head
Rich Harris 1 year ago committed by GitHub
parent a1d74bd56d
commit 5b2d5212d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: expose 'svelte/internal' to prevent Vite erroring on startup

@ -44,6 +44,9 @@
"./elements": {
"types": "./elements.d.ts"
},
"./internal": {
"default": "./src/internal/index.js"
},
"./internal/client": {
"default": "./src/internal/client/index.js"
},

@ -51,6 +51,7 @@ console.group('checking treeshakeability');
for (const key in pkg.exports) {
// special cases
if (key === './compiler') continue;
if (key === './internal') continue;
if (key === './internal/disclose-version') continue;
for (const type of ['browser', 'default']) {

@ -0,0 +1,5 @@
// TODO we may, on a best-effort basis, reimplement some of the legacy private APIs here so that certain libraries continue to work. Those APIs will be marked as deprecated (and should noisily warn the user) and will be removed in a future version of Svelte.
throw new Error(
`Your application, or one of its dependencies, imported from 'svelte/internal', which was a private module used by Svelte 4 components that no longer exists in Svelte 5. It is not intended to be public API. If you're a library author and you used 'svelte/internal' deliberately, please raise an issue on https://github.com/sveltejs/svelte/issues detailing your use case.`
);
Loading…
Cancel
Save