React Native Bundle Analyzer
Choose your JavaScript bundle and its source map. The page counts how many bytes of the bundle come from each package and each file, and lists packages that are in the bundle more than once. The files are read in your browser and never uploaded, and nothing in them is run.
Analyse a bundle
How to see what is in your bundle
- Make a release bundle with a source map (for example with npx react-native bundle and --sourcemap-output, or take both from your release build).
- Choose the bundle, then the .map file, or press “Try the sample bundle”.
- Read the packages first, then the files; type part of a path to find files. Download the lists as CSV or JSON.
How the bytes are counted
- A source map links each piece of the bundle to the file it came from. Each piece runs from its mapping to the next mapping on the same line, and its size is counted in bytes (UTF-8), as the bundle is stored.
- The package of a file is the folder after the last node_modules/ in its path (for example @react-navigation/native). Files outside node_modules are your own code.
- Code that no mapping covers, such as module wrappers and line breaks, is shown as “not mapped”.
- A package found under two different node_modules folders is in the bundle twice; one shared version often makes the bundle smaller.
Limits you should know
- Sizes are of the bundle before compression; the download size of an app is smaller.
- A Hermes bytecode bundle (what release builds with Hermes ship) is not JavaScript text and cannot be measured here; use the JavaScript bundle Metro wrote before it was compiled.
- The source map must belong to exactly this bundle.