refactor(compiler): introduce EmitFlags.CodeGen (#19275)

This flag controls whether the compiler emits generated files.
It is initially calculated via `skipTemplateCodegen` from the
compiler options.

Also:
- adds a small performance improvement to not generate the files
  at all if we don’t emit generated code.
- removes `EmitFlags.Summaries` as we never used it.


PR Close #19275
This commit is contained in:
Tobias Bosch
2017-09-19 11:41:47 -07:00
committed by Igor Minar
parent 8f95b751e0
commit ad7251c8bb
3 changed files with 45 additions and 43 deletions

View File

@ -101,6 +101,9 @@ export function readConfiguration(
if (!(options.skipMetadataEmit || options.flatModuleOutFile)) {
emitFlags |= api.EmitFlags.Metadata;
}
if (options.skipTemplateCodegen) {
emitFlags = emitFlags & ~api.EmitFlags.Codegen;
}
return {project: projectFile, rootNames, options, errors: parsed.errors, emitFlags};
} catch (e) {
const errors: Diagnostics = [{