From 2ba3ada27fc0a052215f2c61af8b0962a43864cf Mon Sep 17 00:00:00 2001 From: Abhimanyu Deora Date: Fri, 7 Jul 2017 10:22:52 -0700 Subject: [PATCH] revert: "refactor(compiler-cli): remove the dependency on fs in codegen.ts (#17738)" This reverts commit b1169014006e6be106c1481b9dbe644fa224d98d. --- packages/compiler-cli/src/codegen.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/compiler-cli/src/codegen.ts b/packages/compiler-cli/src/codegen.ts index e593051665..675e6fbb3d 100644 --- a/packages/compiler-cli/src/codegen.ts +++ b/packages/compiler-cli/src/codegen.ts @@ -13,6 +13,7 @@ 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'; @@ -75,7 +76,7 @@ export class CodeGenerator { throw new Error( `The translation file (${cliOptions.i18nFile}) locale must be provided. Use the --locale option.`); } - transContent = tsCompilerHost.readFile(cliOptions.i18nFile); + transContent = readFileSync(cliOptions.i18nFile, 'utf8'); } let missingTranslation = MissingTranslationStrategy.Warning; if (cliOptions.missingTranslation) {