From b1169014006e6be106c1481b9dbe644fa224d98d Mon Sep 17 00:00:00 2001 From: Abhimanyu Deora Date: Thu, 6 Jul 2017 14:11:21 -0500 Subject: [PATCH] refactor(compiler-cli): remove the dependency on fs in codegen.ts (#17738) --- packages/compiler-cli/src/codegen.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/compiler-cli/src/codegen.ts b/packages/compiler-cli/src/codegen.ts index 675e6fbb3d..e593051665 100644 --- a/packages/compiler-cli/src/codegen.ts +++ b/packages/compiler-cli/src/codegen.ts @@ -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) {