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;