build: resolve review comments on flat modules PR and fix more bugs (#14660)

This commit is contained in:
Jason Aden
2017-02-23 16:39:44 -08:00
committed by Igor Minar
parent 4b54c0e23f
commit c53621be8e
32 changed files with 60 additions and 200 deletions

View File

@ -30,7 +30,7 @@ export type CodegenExtension =
export function main(
project: string | VinylFile, cliOptions: CliOptions, codegen?: CodegenExtension,
options?: ts.CompilerOptions, skipImportRename?: boolean): Promise<any> {
options?: ts.CompilerOptions): Promise<any> {
try {
let projectDir = project;
// project is vinyl like file object
@ -117,7 +117,7 @@ export function main(
const tsickleCompilerHostOptions: tsickle.Options = {
googmodule: false,
untyped: true,
convertIndexImportShorthand: !skipImportRename &&
convertIndexImportShorthand:
ngOptions.target === ts.ScriptTarget.ES2015, // This covers ES6 too
};
@ -172,19 +172,13 @@ export function main(
// CLI entry point
if (require.main === module) {
let args = process.argv.slice(2);
let idx = args.indexOf('--skipImportRename');
let skipImportRename = false;
if (idx !== -1) {
args.splice(idx, 1);
skipImportRename = true;
}
const args = process.argv.slice(2);
let {options, fileNames, errors} = (ts as any).parseCommandLine(args);
check(errors);
const project = options.project || '.';
// TODO(alexeagle): command line should be TSC-compatible, remove "CliOptions" here
const cliOptions = new CliOptions(require('minimist')(args));
main(project, cliOptions, null, options, skipImportRename)
main(project, cliOptions, null, options)
.then((exitCode: any) => process.exit(exitCode))
.catch((e: any) => {
console.error(e.stack);