Retain reexports in js emit even when they export nothing (#37124)

This commit is contained in:
Wesley Wigham
2020-03-02 14:33:53 -08:00
committed by GitHub
parent 478dbfda93
commit af4201ff51
29 changed files with 525 additions and 22 deletions

View File

@@ -2859,9 +2859,11 @@ namespace ts {
return undefined;
}
if (!node.exportClause) {
// Elide a star export if the module it references does not export a value.
return compilerOptions.isolatedModules || resolver.moduleExportsSomeValue(node.moduleSpecifier!) ? node : undefined;
if (!node.exportClause || isNamespaceExport(node.exportClause)) {
// never elide `export <whatever> from <whereever>` declarations -
// they should be kept for sideffects/untyped exports, even when the
// type checker doesn't know about any exports
return node;
}
if (!resolver.isValueAliasDeclaration(node)) {