Skip to content

Commit

Permalink
feat: add 鈥攐nly-mapped option
Browse files Browse the repository at this point in the history
  • Loading branch information
IjzerenHein committed Jul 7, 2020
1 parent 4ad126c commit ec4eeef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -45,6 +45,7 @@ All command-line arguments are optional. By default a production build will be c
| `entry-file` | Entry-file (when omitted tries to auto-resolve it) | `--entry-file ./index.android.js` |
| `bundle-output` | Output bundle-file (default is **tmp**) | `--bundle-output ./myapp.bundle` |
| `format` | Output format **html**, **json** or **tsv** (default is **html**) (see [source-map-explorer options](https://github.com/danvk/source-map-explorer#options)) | `--format json` |
| `only-mapped` | Exclude "unmapped" bytes from the output (default is **false**). This will result in total counts less than the file size. | `--only-mapped` |
| `verbose` | Dumps additional output to the console (default is **false**) | `--verbose` |
| `reset-cache` | Removes cached react-native files (default is **false**) | `--reset-cache` |

Expand Down
2 changes: 2 additions & 0 deletions src/react-native-bundle-visualizer.js
Expand Up @@ -49,6 +49,7 @@ const bundleOutput =
const bundleOutputSourceMap = bundleOutput + '.map';
const format = argv.format || 'html';
const bundleOutputExplorerFile = tmpDir + '/output/explorer.' + format;
const onlyMapped = !!argv['only-mapped'] || false;

// Make sure the temp dir exists
if (!fs.existsSync(baseDir)) fs.mkdirSync(baseDir);
Expand Down Expand Up @@ -128,6 +129,7 @@ bundlePromise
map: bundleOutputSourceMap,
},
{
onlyMapped,
output: {
format,
filename: bundleOutputExplorerFile,
Expand Down

0 comments on commit ec4eeef

Please sign in to comment.