Skip to content

Commit ec4eeef

Browse files
committed
feat: add —only-mapped option
1 parent 4ad126c commit ec4eeef

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ All command-line arguments are optional. By default a production build will be c
4545
| `entry-file` | Entry-file (when omitted tries to auto-resolve it) | `--entry-file ./index.android.js` |
4646
| `bundle-output` | Output bundle-file (default is **tmp**) | `--bundle-output ./myapp.bundle` |
4747
| `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` |
48+
| `only-mapped` | Exclude "unmapped" bytes from the output (default is **false**). This will result in total counts less than the file size. | `--only-mapped` |
4849
| `verbose` | Dumps additional output to the console (default is **false**) | `--verbose` |
4950
| `reset-cache` | Removes cached react-native files (default is **false**) | `--reset-cache` |
5051

Diff for: src/react-native-bundle-visualizer.js

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ const bundleOutput =
4949
const bundleOutputSourceMap = bundleOutput + '.map';
5050
const format = argv.format || 'html';
5151
const bundleOutputExplorerFile = tmpDir + '/output/explorer.' + format;
52+
const onlyMapped = !!argv['only-mapped'] || false;
5253

5354
// Make sure the temp dir exists
5455
if (!fs.existsSync(baseDir)) fs.mkdirSync(baseDir);
@@ -128,6 +129,7 @@ bundlePromise
128129
map: bundleOutputSourceMap,
129130
},
130131
{
132+
onlyMapped,
131133
output: {
132134
format,
133135
filename: bundleOutputExplorerFile,

0 commit comments

Comments
 (0)