diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 7ff56dfa2d..c4695abcec 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -839,6 +839,13 @@ export default class Component { current_group.declarators.push(declarator); } + + if (next) { + const next_variable = component.var_lookup.get(next.id.name) + if (next_variable && !next_variable.export_name) { + code.overwrite(declarator.end, next.start, ` ${node.kind} `); + } + } } else { current_group = null; diff --git a/test/runtime/samples/mixed-let-export/_config.js b/test/runtime/samples/mixed-let-export/_config.js new file mode 100644 index 0000000000..5ac8585742 --- /dev/null +++ b/test/runtime/samples/mixed-let-export/_config.js @@ -0,0 +1,9 @@ +export default { + props: { + a: 42 + }, + + html: ` + 42 + ` +} diff --git a/test/runtime/samples/mixed-let-export/main.svelte b/test/runtime/samples/mixed-let-export/main.svelte new file mode 100644 index 0000000000..659c73a860 --- /dev/null +++ b/test/runtime/samples/mixed-let-export/main.svelte @@ -0,0 +1,7 @@ + + +{a}