revert: "refactor(compiler-cli): remove the dependency on fs in codegen.ts (#17738)"
This reverts commit b116901400
.
This commit is contained in:
parent
8e28382e4a
commit
2ba3ada27f
|
@ -13,6 +13,7 @@
|
||||||
import * as compiler from '@angular/compiler';
|
import * as compiler from '@angular/compiler';
|
||||||
import {MissingTranslationStrategy} from '@angular/core';
|
import {MissingTranslationStrategy} from '@angular/core';
|
||||||
import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
|
import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
|
||||||
|
import {readFileSync} from 'fs';
|
||||||
import * as ts from 'typescript';
|
import * as ts from 'typescript';
|
||||||
|
|
||||||
import {CompilerHost, CompilerHostContext, ModuleResolutionHostAdapter} from './compiler_host';
|
import {CompilerHost, CompilerHostContext, ModuleResolutionHostAdapter} from './compiler_host';
|
||||||
|
@ -75,7 +76,7 @@ export class CodeGenerator {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
`The translation file (${cliOptions.i18nFile}) locale must be provided. Use the --locale option.`);
|
`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;
|
let missingTranslation = MissingTranslationStrategy.Warning;
|
||||||
if (cliOptions.missingTranslation) {
|
if (cliOptions.missingTranslation) {
|
||||||
|
|
Loading…
Reference in New Issue