Move bundle output formats to their own files

Reviewed By: tadeuzagallo

Differential Revision: D2702834

fb-gh-sync-id: fca308c5078a11924e071077822fb77d762bd564
This commit is contained in:
David Aurelio
2015-11-30 08:31:35 -08:00
committed by facebook-github-bot-4
parent 3c382a7619
commit 32fa0b7fa1
5 changed files with 148 additions and 91 deletions

View File

@@ -11,12 +11,16 @@
const buildBundle = require('./buildBundle');
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
const parseCommandLine = require('../util/parseCommandLine');
const outputBundle = require('./output/bundle');
const outputPrepack = require('./output/prepack');
/**
* Builds the bundle starting to look for dependencies at the given entry path.
*/
function bundle(argv, config) {
return buildBundle(parseCommandLine(bundleCommandLineArgs, argv), config);
const args = parseCommandLine(bundleCommandLineArgs, argv);
const output = args.prepack ? outputPrepack : outputBundle;
return buildBundle(args, config, output);
}
module.exports = bundle;