#!/usr/bin/env node"use strict";Object.defineProperty(exports,"__esModule",{value:true});require("reflect-metadata");varts=require("typescript");varmain_1=require("../main");varbundle_index_host_1=require("./bundle_index_host");varng=require("../transformers/entry_points");functionmain(args,consoleError){if(consoleError===void0){consoleError=console.error;}var_a=main_1.readCommandLineAndConfiguration(args),options=_a.options,rootNames=_a.rootNames;varhost=ng.createCompilerHost({options:options});var_b=bundle_index_host_1.createBundleIndexHost(options,rootNames,host),bundleHost=_b.host,indexName=_b.indexName,errors=_b.errors;if(!indexName){console.error('Did not find an index.ts in the top-level of the package.');return1;}// The index file is synthetic, so we have to add it to the program after parsing the tsconfigrootNames.push(indexName);varprogram=ts.createProgram(rootNames,options,bundleHost);varindexSourceFile=program.getSourceFile(indexName);if(!indexSourceFile){console.error(indexSourceFile+" is not in the program. Please file a bug.");return1;}program.emit(indexSourceFile);return0;}exports.main=main;// CLI entry pointif(require.main===module){varargs=process.argv.slice(2);process.exitCode=main(args);}//# sourceMappingURL=bundle_index_main.js.map