Skip to content

Commit 5b2d521

Browse files
authored
feat: expose 'svelte/internal' (#10987)
* feat: expose svelte/internal * fix
1 parent a1d74bd commit 5b2d521

File tree

4 files changed

+14
-0
lines changed

4 files changed

+14
-0
lines changed

.changeset/loud-mugs-smile.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'svelte': patch
3+
---
4+
5+
fix: expose 'svelte/internal' to prevent Vite erroring on startup

packages/svelte/package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
"./elements": {
4545
"types": "./elements.d.ts"
4646
},
47+
"./internal": {
48+
"default": "./src/internal/index.js"
49+
},
4750
"./internal/client": {
4851
"default": "./src/internal/client/index.js"
4952
},

packages/svelte/scripts/check-treeshakeability.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ console.group('checking treeshakeability');
5151
for (const key in pkg.exports) {
5252
// special cases
5353
if (key === './compiler') continue;
54+
if (key === './internal') continue;
5455
if (key === './internal/disclose-version') continue;
5556

5657
for (const type of ['browser', 'default']) {

packages/svelte/src/internal/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// 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.
2+
3+
throw new Error(
4+
`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.`
5+
);

0 commit comments

Comments
 (0)