Add --indexed-unbundle flag to force iOS ra-bundle format

Summary: This adds a new flag to the `unbundle` command: `--indexed-unbundle` allows to output the indexed file format even when building for android.

Reviewed By: cpojer

Differential Revision: D4189485

fbshipit-source-id: e56192456de764eb38c25b574ceaaf52eb8a6fca
This commit is contained in:
David Aurelio
2016-11-17 02:36:00 -08:00
committed by Facebook Github Bot
parent a9338d6af1
commit 112bdc99dc
2 changed files with 6 additions and 2 deletions

View File

@@ -23,7 +23,7 @@ function saveUnbundle(bundle, options, log) {
// we fork here depending on the platform:
// while android is pretty good at loading individual assets, ios has a large
// overhead when reading hundreds pf assets from disk
return options.platform === 'android' ?
return options.platform === 'android' && !options.indexedUnbundle ?
asAssets(bundle, options, log) :
asIndexedFile(bundle, options, log);
}

View File

@@ -23,5 +23,9 @@ module.exports = {
name: 'unbundle',
description: 'builds javascript as "unbundle" for offline use',
func: unbundle,
options: bundleCommandLineArgs,
options: bundleCommandLineArgs.concat({
command: '--indexed-unbundle',
description: 'Force indexed unbundle file format, even when building for android',
default: false,
}),
};