allow transpiler to provide alternative names for dependencies

This commit is contained in:
Vladimir Matveev
2015-08-14 13:00:41 -07:00
parent 5fbe3fc75c
commit 7e8cfa0859
4 changed files with 109 additions and 12 deletions

View File

@@ -1767,6 +1767,7 @@ namespace ts {
fileName?: string;
reportDiagnostics?: boolean;
moduleName?: string;
renamedDependencies?: Map<string>;
}
export interface TranspileOutput {
@@ -1784,7 +1785,7 @@ namespace ts {
* - noLib = true
* - noResolve = true
*/
export function transpileModule(input: string, transpileOptions?: TranspileOptions): TranspileOutput {
export function transpileModule(input: string, transpileOptions: TranspileOptions): TranspileOutput {
let options = transpileOptions.compilerOptions ? clone(transpileOptions.compilerOptions) : getDefaultCompilerOptions();
options.isolatedModules = true;
@@ -1807,6 +1808,8 @@ namespace ts {
sourceFile.moduleName = transpileOptions.moduleName;
}
sourceFile.renamedDependencies = transpileOptions.renamedDependencies;
let newLine = getNewLineCharacter(options);
// Output