Skip to content

Commit

Permalink
Add --indexed-unbundle flag to force iOS ra-bundle format
Browse files Browse the repository at this point in the history
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
  • Loading branch information
davidaurelio authored and Facebook Github Bot committed Nov 17, 2016
1 parent a9338d6 commit 112bdc9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion local-cli/bundle/output/unbundle/index.js
Expand Up @@ -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);
}
Expand Down
6 changes: 5 additions & 1 deletion local-cli/bundle/unbundle.js
Expand Up @@ -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,
}),
};

1 comment on commit 112bdc9

@njafei
Copy link

@njafei njafei commented on 112bdc9 Feb 4, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

may I ask why we need this feature?I'm confused. thanks

Please sign in to comment.