diff --git a/modules/@angular/compiler-cli/src/extractor.ts b/modules/@angular/compiler-cli/src/extractor.ts index b51e1ce0d7..a6f27fb9e2 100644 --- a/modules/@angular/compiler-cli/src/extractor.ts +++ b/modules/@angular/compiler-cli/src/extractor.ts @@ -31,10 +31,7 @@ export class Extractor { // Checks the format and returns the extension const ext = this.getExtension(formatName); - const files = this.program.getSourceFiles().map( - sf => this.ngCompilerHost.getCanonicalFileName(sf.fileName)); - - const promiseBundle = this.ngExtractor.extract(files); + const promiseBundle = this.extractBundle(); return promiseBundle.then(bundle => { const content = this.serialize(bundle, ext); @@ -43,6 +40,13 @@ export class Extractor { }); } + extractBundle(): Promise { + const files = this.program.getSourceFiles().map( + sf => this.ngCompilerHost.getCanonicalFileName(sf.fileName)); + + return this.ngExtractor.extract(files); + } + serialize(bundle: compiler.MessageBundle, ext: string): string { let serializer: compiler.Serializer;