fix(compiler-cli): propagate ts.SourceFile moduleName into metadata

This commit is contained in:
Alex Eagle
2017-11-30 14:34:01 -08:00
committed by Alex Rickabaugh
parent b9a91a5e74
commit f841fbe60f
3 changed files with 13 additions and 0 deletions

View File

@ -550,6 +550,7 @@ export class MetadataCollector {
__symbolic: 'module',
version: this.options.version || METADATA_VERSION, metadata
};
if (sourceFile.moduleName) result.importAs = sourceFile.moduleName;
if (exports) result.exports = exports;
return result;
}

View File

@ -112,6 +112,7 @@ function upgradeMetadataWithDtsData(
newMetadata.metadata[prop] = dtsMetadata.metadata[prop];
}
}
if (dtsMetadata['importAs']) newMetadata['importAs'] = dtsMetadata['importAs'];
// Only copy exports from exports from metadata prior to version 3.
// Starting with version 3 the collector began collecting exports and