From e1e455d6ed12281fc9f61640d1bf7845d306e188 Mon Sep 17 00:00:00 2001 From: Corey Lenertz Date: Wed, 27 Sep 2017 12:13:29 -0700 Subject: [PATCH] Use latest TypeScript compiler API Please read more at https://github.com/Microsoft/TypeScript-wiki/blob/master/Using-the-Compiler-API.md#a-minimal-compiler The object returned by `program.emit()` appears to match the previous api ```{ emitSkipped: false, diagnostics: [], sourceMaps: undefined }``` Fixes #18 --- index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 94ab43f..5553e81 100644 --- a/index.ts +++ b/index.ts @@ -140,7 +140,7 @@ function compile(filename: string, options: typescript.CompilerOptions): void { var host = typescript.createCompilerHost(options); var program = typescript.createProgram([filename], options, host); var checker = program.getTypeChecker(true); - var result = checker.emitFiles(); + var result = program.emit(); if (emitError()) { checkErrors(program.getDiagnostics() .concat(checker.getDiagnostics()