Report format (metro-stats.json)
Structure of the JSON report generated by createSerializer, BundleDiscoveryPlugin and bundleDiscoveryRollipopPlugin.
createSerializer (Metro), BundleDiscoveryPlugin (Re.Pack) and bundleDiscoveryRollipopPlugin (Rollipop) write the report as a single JSON file, metro-stats.json by default. The UI and CLI read it.
The UI and CLI also accept an Rsdoctor report and an esbuild metafile as is. Those files have their own formats and are not described here.
Example
{
"date": 1791147980685,
"entryPoint": "/Users/me/MyApp/index.js",
"rootFolder": "/Users/me/MyApp",
"transformOptions": {
"dev": false,
"minify": true,
"platform": "ios",
"type": "module",
"unstable_transformProfile": "default",
"customTransformOptions": {}
},
"envs": {},
"packages": [
{
"name": "metro-runtime",
"absolutePath": "/Users/me/MyApp/node_modules/metro-runtime",
"version": "0.87.0",
"metadata": {
"createdAt": "2026-07-13T15:27:34.375Z",
"deprecated": false,
"isLatest": false,
"latestVersion": "0.87.1"
}
}
],
"modules": [
{
"path": "/Users/me/MyApp/node_modules/metro-runtime/src/polyfills/require.js",
"source": { "code": "\"use strict\";…", "lineCount": 727, "sizeInBytes": 21843 },
"output": { "code": "!(function(e){…", "lineCount": 1, "sizeInBytes": 2119 },
"dependencies": []
}
]
}Root object
| Field | Type | Description |
|---|---|---|
kind | string? | Bundler that created the report: metro, webpack (Re.Pack) or rollipop. |
date | number | When the report was created (Unix time in milliseconds). |
entryPoint | string | Absolute path to the bundle entry file. |
rootFolder | string | Project root (projectRoot option). The UI shows module paths relative to it. |
transformOptions | TransformOptions | Options the bundle was built with. |
envs | Record<string, string | undefined> | Values of the environment variables listed in includeEnvs. Empty object by default. |
packages | Package[] | Every installed copy of a package that has modules in the bundle, sorted by name. |
modules | Module[] | Every module of the bundle, including Metro's pre-modules such as __prelude__ and polyfills. |
TransformOptions
Copied from Metro's transform options, so it can contain extra fields.
| Field | Type | Description |
|---|---|---|
dev | boolean | true for a development bundle. Production reports have false. |
minify | boolean | Whether the output code is minified. |
platform | string | Target platform, for example ios or android. |
type | string? | Module type, for example module. |
unstable_transformProfile | string? | Metro transform profile, for example default or hermes-stable. |
customTransformOptions | Record<string, unknown>? | Custom options passed to the transformer. |
Package
One entry per installed copy: if two versions of a package end up in the bundle, both are listed with different absolutePaths. That's how duplicates are detected.
| Field | Type | Description |
|---|---|---|
name | string | Package name, for example react-native or @babel/runtime. |
absolutePath | string | Absolute path to the package folder inside node_modules. |
version | string | Installed version from the package's package.json. |
metadata | PackageMetadata | null, optional | Info from the npm registry. Missing when fetchPackagesMetadata: false, null when the lookup failed. |
PackageMetadata
| Field | Type | Description |
|---|---|---|
createdAt | string | null | Publish date of the installed version (ISO 8601). |
deprecated | string | false | Deprecation message of the installed version, or false. |
isLatest | boolean | Whether the installed version is the latest one. |
latestVersion | string | null | The latest version on npm. |
Module
| Field | Type | Description |
|---|---|---|
path | string | Absolute path to the file, or a virtual name such as __prelude__. |
source | Code | The original file, before transformation. |
output | Code | The transformed code as it appears in the bundle. Bundle sizes in the UI and CLI use it. |
dependencies | Dependency[] | Modules this module imports. |
Code
| Field | Type | Description |
|---|---|---|
code | string | The code itself. Empty string with includeCode: false, and for image and font assets in source. |
lineCount | number | Number of lines. |
sizeInBytes | number | Size in bytes (UTF-8). Always present, even when code is empty. |
Dependency
| Field | Type | Description |
|---|---|---|
name | string | The import specifier as written in the code, for example ./utils. |
absolutePath | string | Resolved path of the imported module (matches its path). |
The "Imported by" graph and "Why is this in my bundle?" chains are built from dependencies.
With includeCode: true (the default) source.code and output.code contain your source code. Be careful who you share the report with.