Skip to content

Commit 38171f6

Browse files
fix: allow exports with source from script module even if no bind is present (#14620)
* fix: allow exports with source from script module even if no bind is present * chore: move test to validator
1 parent 0a10c59 commit 38171f6

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

.changeset/four-carrots-burn.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: allow exports with source from script module even if no bind is present

packages/svelte/src/compiler/phases/2-analyze/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ export function analyze_component(root, source, options) {
698698
}
699699

700700
for (const node of analysis.module.ast.body) {
701-
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null) {
701+
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) {
702702
for (const specifier of node.specifiers) {
703703
if (specifier.local.type !== 'Identifier') continue;
704704

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<script module>
2+
export { something } from "./something.js";
3+
</script>

0 commit comments

Comments
 (0)