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
pull/14635/head
Paolo Ricciuti 9 months ago committed by GitHub
parent 0a10c59517
commit 38171f60ea
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: allow exports with source from script module even if no bind is present

@ -698,7 +698,7 @@ export function analyze_component(root, source, options) {
}
for (const node of analysis.module.ast.body) {
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null) {
if (node.type === 'ExportNamedDeclaration' && node.specifiers !== null && node.source == null) {
for (const specifier of node.specifiers) {
if (specifier.local.type !== 'Identifier') continue;

@ -0,0 +1,3 @@
<script module>
export { something } from "./something.js";
</script>
Loading…
Cancel
Save