refactor(compiler-cli): refactor imports in codegen to enable rollup (#12781)

This commit is contained in:
Chuck Jazdzewski 2016-11-09 15:17:24 -08:00 committed by Victor Berchet
parent f80a157b65
commit 4595a61aeb
1 changed files with 2 additions and 3 deletions

View File

@ -13,6 +13,7 @@
import * as compiler from '@angular/compiler';
import {ViewEncapsulation} from '@angular/core';
import {AngularCompilerOptions, NgcCliOptions} from '@angular/tsc-wrapped';
import {readFileSync} from 'fs';
import * as path from 'path';
import * as ts from 'typescript';
@ -22,8 +23,6 @@ import {ReflectorHost, ReflectorHostContext} from './reflector_host';
import {StaticAndDynamicReflectionCapabilities} from './static_reflection_capabilities';
import {StaticReflector, StaticReflectorHost, StaticSymbol} from './static_reflector';
const nodeFs = require('fs');
const GENERATED_FILES = /\.ngfactory\.ts$|\.css\.ts$|\.css\.shim\.ts$/;
const GENERATED_OR_DTS_FILES = /\.d\.ts$|\.ngfactory\.ts$|\.css\.ts$|\.css\.shim\.ts$/;
@ -100,7 +99,7 @@ export class CodeGenerator {
throw new Error(
`The translation file (${transFile}) locale must be provided. Use the --locale option.`);
}
transContent = nodeFs.readFileSync(transFile, 'utf8');
transContent = readFileSync(transFile, 'utf8');
}
const urlResolver: compiler.UrlResolver = compiler.createOfflineCompileUrlResolver();