Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
untyped: false,
logWarning: (warning) => console.error(ts.formatDiagnostics([warning], compilerHost)),
options,
moduleResolutionHost: compilerHost,
};
const diagnostics = ts.getPreEmitDiagnostics(program);
if (diagnostics.length > 0) {
return {
diagnostics,
modulesManifest: new tsickle.ModulesManifest(),
externs: {},
emitSkipped: true,
emittedFiles: [],
};
}
return tsickle.emit(program, transformerHost, writeFile);
}
this.overrideBazelHost();
if (typeof this.bazelOpts.maxCacheSizeMb === 'number') {
const maxCacheSizeBytes = this.bazelOpts.maxCacheSizeMb * (1 << 20);
this.fileCache.setMaxCacheSize(maxCacheSizeBytes);
} else {
this.fileCache.resetMaxCacheSize();
}
this.program = ts.createProgram({
rootNames: this.files,
options: this.compilerOpts,
host: this.bazelHost,
});
const emitResult = tsickle.emit(
this.program,
this.bazelHost,
this.bazelHost.writeFile,
);
const allDiagnostics = this.gatherDiagnosticsForInputsOnly();
allDiagnostics.push(...emitResult.diagnostics);
let externs = '/** @externs */\n';
if (!emitResult.diagnostics.length) {
if (this.bazelOpts.tsickleGenerateExterns) {
externs += tsickle.getGeneratedExterns(emitResult.externs);
}
if (this.bazelOpts.manifest) {
const manifest = constructManifest(
emitResult.modulesManifest,