Skip to content
This repository was archived by the owner on May 22, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -208,18 +208,14 @@ function toClosureJS(
// place of the original source.
let host = createSourceReplacingCompilerHost(tsickleOutput, ts.createCompilerHost(options));
program = ts.createProgram(fileNames, options, host);
let diagnostics = ts.getPreEmitDiagnostics(program);
if (diagnostics.length > 0) {
allDiagnostics.push(...diagnostics);
return null;
}

// Emit, creating a map of fileName => generated JS source.
const jsFiles = new Map<string, string>();
function writeFile(fileName: string, data: string): void {
jsFiles.set(fileName, data);
}
({diagnostics} = program.emit(undefined, writeFile));

let {diagnostics} = program.emit(undefined, writeFile);
if (diagnostics.length > 0) {
allDiagnostics.push(...diagnostics);
return null;
Expand Down