feature(tsc-wrapped): re-write /index imports for closure compiler (#13471)

This commit is contained in:
Alex Eagle
2017-01-12 17:33:44 -08:00
committed by Miško Hevery
parent b1e3dda5cb
commit 5047d9780d
2 changed files with 12 additions and 8 deletions

View File

@ -99,9 +99,10 @@ export class TsickleCompilerHost extends DelegatingHost {
// Don't tsickle-process any d.ts that isn't a compilation target;
// this means we don't process e.g. lib.d.ts.
if (isDefinitions) return sourceFile;
let {output, externs, diagnostics} =
tsickle.annotate(this.oldProgram, sourceFile, {untyped: true});
const es2015Target = this.options.target == ts.ScriptTarget.ES2015; // This covers ES6 too
let {output, externs, diagnostics} = tsickle.annotate(
this.oldProgram, sourceFile, {untyped: true, convertIndexImportShorthand: es2015Target},
this.delegate, this.options);
this.diagnostics = diagnostics;
return ts.createSourceFile(fileName, output, languageVersion, true);
}