refactor(compiler): add ability to produce stub .ngfactory / .ngsummary files (#16963)

These files are needed so that:
- user code can compile even without real codegen
- as tsc transformers cannot create but only change existing files
  in the transformation pipeline.
This commit is contained in:
Tobias Bosch
2017-05-23 13:40:50 -07:00
committed by Chuck Jazdzewski
parent fa809ec8cf
commit eba59aaf87
6 changed files with 211 additions and 84 deletions

View File

@ -38,8 +38,9 @@ export class CodeGenerator {
codegen(): Promise<any> {
return this.compiler
.compileAllAsync(this.program.getSourceFiles().map(
.analyzeModulesAsync(this.program.getSourceFiles().map(
sf => this.ngCompilerHost.getCanonicalFileName(sf.fileName)))
.then(analyzedModules => this.compiler.emitAllImpls(analyzedModules))
.then(generatedModules => {
generatedModules.forEach(generatedModule => {
const sourceFile = this.program.getSourceFile(generatedModule.srcFileUrl);