feat(compiler-cli): add an outFile
option to ng-xi18n
Fixes #11416 Closes #14508 Closes #14657
This commit is contained in:
@ -27,7 +27,7 @@ export class Extractor {
|
||||
public host: ts.CompilerHost, private ngCompilerHost: CompilerHost,
|
||||
private program: ts.Program) {}
|
||||
|
||||
extract(formatName: string): Promise<void> {
|
||||
extract(formatName: string, outFile: string|null): Promise<void> {
|
||||
// Checks the format and returns the extension
|
||||
const ext = this.getExtension(formatName);
|
||||
|
||||
@ -35,7 +35,8 @@ export class Extractor {
|
||||
|
||||
return promiseBundle.then(bundle => {
|
||||
const content = this.serialize(bundle, ext);
|
||||
const dstPath = path.join(this.options.genDir, `messages.${ext}`);
|
||||
const dstFile = outFile || `messages.${ext}`;
|
||||
const dstPath = path.join(this.options.genDir, dstFile);
|
||||
this.host.writeFile(dstPath, content, false);
|
||||
});
|
||||
}
|
||||
|
Reference in New Issue
Block a user