Skip to content

Commit

Permalink
[api-extractor] Don't export trimmed namespace members during rollup (m…
Browse files Browse the repository at this point in the history
  • Loading branch information
SchoofsKelvin committed Jul 7, 2021
1 parent 7c803c9 commit 91b8a78
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/generators/DtsRollupGenerator.ts
Expand Up @@ -203,6 +203,15 @@ export class DtsRollupGenerator {
);
}

// If the entity's declaration won't be included, then neither should the namespace export it
// This fixes the issue encountered here: https://github.com/microsoft/rushstack/issues/2791
const symbolMetadata: SymbolMetadata | undefined =
collector.tryFetchMetadataForAstEntity(exportedEntity);
const maxEffectiveReleaseTag: ReleaseTag = symbolMetadata
? symbolMetadata.maxEffectiveReleaseTag
: ReleaseTag.None;
if (!this._shouldIncludeReleaseTag(maxEffectiveReleaseTag, dtsKind)) continue;

if (collectorEntity.nameForEmit === exportedName) {
exportClauses.push(collectorEntity.nameForEmit);
} else {
Expand Down

0 comments on commit 91b8a78

Please sign in to comment.