pull/9482/head
Rich Harris 3 years ago
parent e6102df585
commit abee31e36a

@ -674,6 +674,8 @@ const runes_scope_tweaker = {
} }
}, },
ExportSpecifier(node, { state }) { ExportSpecifier(node, { state }) {
if (state.ast_type !== 'instance') return;
state.analysis.exports.push({ state.analysis.exports.push({
name: node.local.name, name: node.local.name,
alias: node.exported.name alias: node.exported.name

@ -15,14 +15,14 @@ export const remove_types = {
return node; return node;
}, },
ExportNamedDeclaration(node, context) { ExportNamedDeclaration(node, context) {
if (node.importKind === 'type') return b.empty; if (node.exportKind === 'type') return b.empty;
if (node.declaration) { if (node.declaration) {
return context.next(); return context.next();
} }
if (node.specifiers) { if (node.specifiers) {
const specifiers = node.specifiers.filter((s) => s.importKind !== 'type'); const specifiers = node.specifiers.filter((s) => s.exportKind !== 'type');
if (specifiers.length === 0) return b.empty; if (specifiers.length === 0) return b.empty;
return { ...node, specifiers }; return { ...node, specifiers };

Loading…
Cancel
Save