refactor(compiler-cli): remove the dependency on fs in codegen.ts (#17738)

This commit is contained in:
Abhimanyu Deora 2017-07-06 14:11:21 -05:00 committed by Jason Aden
parent 70981c601e
commit b116901400
1 changed files with 1 additions and 2 deletions

View File

@ -13,7 +13,6 @@
import * as compiler from '@angular/compiler';
import {MissingTranslationStrategy} from '@angular/core';
import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
import {readFileSync} from 'fs';
import * as ts from 'typescript';
import {CompilerHost, CompilerHostContext, ModuleResolutionHostAdapter} from './compiler_host';
@ -76,7 +75,7 @@ export class CodeGenerator {
throw new Error(
`The translation file (${cliOptions.i18nFile}) locale must be provided. Use the --locale option.`);
}
transContent = readFileSync(cliOptions.i18nFile, 'utf8');
transContent = tsCompilerHost.readFile(cliOptions.i18nFile);
}
let missingTranslation = MissingTranslationStrategy.Warning;
if (cliOptions.missingTranslation) {