refactor(compiler): use new ngc for i18n (#19095)

This also changes ngc to support all tsc command line arguments.
PR Close #19095
This commit is contained in:
Tobias Bosch
2017-09-12 15:53:17 -07:00
committed by Matias Niemelä
parent c8f742e288
commit bf94f878bc
13 changed files with 650 additions and 334 deletions

View File

@ -90,12 +90,11 @@ export class NgTools_InternalApi_NG_2 {
const hostContext: CompilerHostContext =
new CustomLoaderModuleResolutionHostAdapter(options.readResource, options.host);
const cliOptions: NgcCliOptions = {
const i18nOptions = {
i18nFormat: options.i18nFormat !,
i18nFile: options.i18nFile !,
locale: options.locale !,
missingTranslation: options.missingTranslation !,
basePath: options.basePath
};
const ngOptions = options.angularCompilerOptions;
if (ngOptions.enableSummariesForJit === undefined) {
@ -105,7 +104,7 @@ export class NgTools_InternalApi_NG_2 {
// Create the Code Generator.
const codeGenerator =
CodeGenerator.create(ngOptions, cliOptions, options.program, options.host, hostContext);
CodeGenerator.create(ngOptions, i18nOptions, options.program, options.host, hostContext);
return codeGenerator.codegen();
}