2015-12-01 07:42:44 -08:00
|
|
|
/**
|
|
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
|
|
*
|
2018-02-16 18:24:55 -08:00
|
|
|
* This source code is licensed under the MIT license found in the
|
|
|
|
* LICENSE file in the root directory of this source tree.
|
2015-12-01 07:42:44 -08:00
|
|
|
*/
|
2016-11-14 11:12:24 -08:00
|
|
|
'use strict';
|
2015-12-01 07:42:44 -08:00
|
|
|
|
|
|
|
const bundleWithOutput = require('./bundle').withOutput;
|
2016-07-30 08:59:16 -07:00
|
|
|
const bundleCommandLineArgs = require('./bundleCommandLineArgs');
|
2017-11-29 03:00:49 -08:00
|
|
|
const outputUnbundle = require('metro/src/shared/output/unbundle');
|
2015-12-01 07:42:44 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Builds the bundle starting to look for dependencies at the given entry path.
|
|
|
|
*/
|
2018-01-12 06:23:16 -08:00
|
|
|
function unbundle(argv, config, args) {
|
|
|
|
return bundleWithOutput(argv, config, args, outputUnbundle);
|
2015-12-01 07:42:44 -08:00
|
|
|
}
|
|
|
|
|
2016-07-30 08:59:16 -07:00
|
|
|
module.exports = {
|
|
|
|
name: 'unbundle',
|
|
|
|
description: 'builds javascript as "unbundle" for offline use',
|
|
|
|
func: unbundle,
|
2016-11-17 02:36:00 -08:00
|
|
|
options: bundleCommandLineArgs.concat({
|
|
|
|
command: '--indexed-unbundle',
|
|
|
|
description: 'Force indexed unbundle file format, even when building for android',
|
|
|
|
default: false,
|
|
|
|
}),
|
2016-07-30 08:59:16 -07:00
|
|
|
};
|