Skip to content

Commit c95e760

Browse files
authored
Merge branch 'master' into feature/mgechev#1614
2 parents ea0ea2d + 82d4da1 commit c95e760

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

tools/tasks/seed/compile.ahead.prod.ts

+7-8
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import 'reflect-metadata';
22
import * as ts from 'typescript';
3-
import * as tsc from '@angular/tsc-wrapped';
43
import { argv } from 'yargs';
54
import { join } from 'path';
65
import { writeFileSync, readFileSync } from 'fs';
7-
import { CodeGenerator } from '@angular/compiler-cli';
6+
import { CodeGenerator, AngularCompilerOptions, NgcCliOptions, main } from '@angular/compiler-cli';
87

98
import Config from '../../config';
109

1110
function codegen(
12-
ngOptions: tsc.AngularCompilerOptions, cliOptions: tsc.NgcCliOptions, program: ts.Program,
13-
host: ts.CompilerHost) {
14-
return CodeGenerator.create(ngOptions, cliOptions, program, host).codegen({transitiveModules: true});
11+
ngOptions: AngularCompilerOptions, cliOptions: NgcCliOptions, program: ts.Program,
12+
host: ts.CompilerHost) {
13+
return CodeGenerator.create(ngOptions, cliOptions, program, host).codegen({ transitiveModules: true });
1514
}
1615

1716
const modifyFile = (path: string, mod: any = (f: string) => f) => {
@@ -30,14 +29,14 @@ export = (done: any) => {
3029
const args = argv;
3130

3231
// If a translation, tell the compiler
33-
if(args.lang) {
32+
if (args.lang) {
3433
args['i18nFile'] = `./src/client/assets/locale/messages.${args.lang}.xlf`;
3534
args['locale'] = args.lang;
3635
args['i18nFormat'] = 'xlf';
3736
}
3837

39-
const cliOptions = new tsc.NgcCliOptions(args);
40-
tsc.main(Config.TMP_DIR, cliOptions, codegen)
38+
const cliOptions = new NgcCliOptions(args);
39+
main(Config.TMP_DIR, cliOptions, codegen)
4140
.then(done)
4241
.catch(e => {
4342
console.error(e.stack);

0 commit comments

Comments
 (0)