Revert "Revert "Revert "perf(compiler): skip type check and emit in bazel in some cases. (#19646)"""

This reverts commit 6b7cead0c5.
This commit is contained in:
Tobias Bosch
2017-10-12 16:09:49 -07:00
parent 522ec9a25b
commit 653a211743
21 changed files with 297 additions and 596 deletions

View File

@ -39,7 +39,7 @@ export function main(
return reportErrorsAndExit(options, compileDiags, consoleError);
}
function createEmitCallback(options: api.CompilerOptions): api.EmitCallback|undefined {
function createEmitCallback(options: api.CompilerOptions): api.TsEmitCallback|undefined {
const transformDecorators = options.annotationsAs !== 'decorators';
const transformTypesToClosure = options.annotateForClosureCompiler;
if (!transformDecorators && !transformTypesToClosure) {
@ -58,30 +58,20 @@ function createEmitCallback(options: api.CompilerOptions): api.EmitCallback|unde
return ({
program,
targetSourceFiles,
targetSourceFile,
writeFile,
cancellationToken,
emitOnlyDtsFiles,
customTransformers = {},
host,
options
}) => {
if (targetSourceFiles) {
return tsickle.mergeEmitResults(targetSourceFiles.map(
targetSourceFile => tsickle.emitWithTsickle(
program, tsickleHost, host, options, targetSourceFile, writeFile, cancellationToken,
emitOnlyDtsFiles, {
beforeTs: customTransformers.before,
afterTs: customTransformers.after,
})));
}
return tsickle.emitWithTsickle(
program, tsickleHost, host, options, /*targetSourceFile*/ undefined, writeFile,
cancellationToken, emitOnlyDtsFiles, {
beforeTs: customTransformers.before,
afterTs: customTransformers.after,
});
};
}) =>
tsickle.emitWithTsickle(
program, tsickleHost, host, options, targetSourceFile, writeFile,
cancellationToken, emitOnlyDtsFiles, {
beforeTs: customTransformers.before,
afterTs: customTransformers.after,
});
}
export interface NgcParsedConfiguration extends ParsedConfiguration { watch?: boolean; }