From 040f0f03b5e87645569beb532834503a5b161e15 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Sat, 24 Nov 2018 22:39:17 -0500 Subject: [PATCH] handle export {...} in script, fix test --- src/compile/Component.ts | 1 + test/runtime/samples/dynamic-component-in-if/main.html | 1 + 2 files changed, 2 insertions(+) diff --git a/src/compile/Component.ts b/src/compile/Component.ts index 057df7b5e2..5c1d540994 100644 --- a/src/compile/Component.ts +++ b/src/compile/Component.ts @@ -462,6 +462,7 @@ export default class Component { code.remove(node.start, node.declaration.start); } else { + removeNode(code, content.start, content.end, content.body, node); node.specifiers.forEach(specifier => { exports.push({ name: specifier.local.name, diff --git a/test/runtime/samples/dynamic-component-in-if/main.html b/test/runtime/samples/dynamic-component-in-if/main.html index 8e4c51068e..dfd6f6a085 100644 --- a/test/runtime/samples/dynamic-component-in-if/main.html +++ b/test/runtime/samples/dynamic-component-in-if/main.html @@ -2,6 +2,7 @@ import Foo from './Foo.html'; import Bar from './Bar.html'; + export { Bar }; export let x = Foo;