From 267ca97bf52f56f6ee04abeaf2111468c15f087d Mon Sep 17 00:00:00 2001 From: paoloricciuti Date: Wed, 9 Oct 2024 17:46:15 +0200 Subject: [PATCH] chore: only emit named exports in runes mode --- packages/svelte2tsx/src/svelte2tsx/nodes/ExportedNames.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/svelte2tsx/src/svelte2tsx/nodes/ExportedNames.ts b/packages/svelte2tsx/src/svelte2tsx/nodes/ExportedNames.ts index 253c3c6f5..91ec37aba 100644 --- a/packages/svelte2tsx/src/svelte2tsx/nodes/ExportedNames.ts +++ b/packages/svelte2tsx/src/svelte2tsx/nodes/ExportedNames.ts @@ -709,7 +709,9 @@ export class ExportedNames { */ createExportsStr(): string { const names = Array.from(this.exports.entries()); - const others = names.filter(([, { isLet, isNamedExport }]) => !isLet || isNamedExport); + const others = names.filter( + ([, { isLet, isNamedExport }]) => !isLet || (this.usesRunes() && isNamedExport) + ); const needsAccessors = this.usesAccessors && names.length > 0 && !this.usesRunes(); // runes mode doesn't support accessors if (this.isSvelte5Plus) {