Socket
Book a DemoInstallSign in
Socket

react-native-bundle-visualizer

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-native-bundle-visualizer

See what's inside your react-native bundle

Source
npmnpm
Version
2.2.1
Version published
Weekly downloads
52K
119.72%
Maintainers
1
Weekly downloads
 
Created
Source

react-native-bundle-visualizer

See what's inside of your react-native bundle 📦

bundle-visualizer-animation

Uses the awesome source-map-explorer to visualize the output of the Metro bundler.

Purpose

Sometimes, importing a single javascript library can drastically increase your bundle size. This package helps you to identify such a library, so you can keep the bundle size low and loading times fast.

Usage

Make sure npx is installed and run the following command in your project root

npx react-native-bundle-visualizer

And when using Expo:

npx react-native-bundle-visualizer --expo managed

Or install as a dev-dependency

yarn add --dev react-native-bundle-visualizer

And run it:

yarn run react-native-bundle-visualizer

or when using npm:

npm install --save-dev react-native-bundle-visualizer
./node_modules/.bin/react-native-bundle-visualizer

Command line arguments

All command-line arguments are optional. By default a production build will be created for the ios platform.

OptionDescriptionExample
platformPlatform to build (default is ios)--platform android
expoExpo target, managed or bare. This ensures that the project is bundled with expo settings and that .expo file extensions are handled appropriately.--expo bare
devDev or production build (default is false)--dev false
entry-fileEntry-file (when omitted tries to auto-resolve it)--entry-file ./index.android.js
bundle-outputOutput bundle-file (default is tmp)--bundle-output ./myapp.bundle
formatOutput format html, json or tsv (default is html) (see source-map-explorer options)--format json
only-mappedExclude "unmapped" bytes from the output (default is false). This will result in total counts less than the file size.--only-mapped
verboseDumps additional output to the console (default is false)--verbose
reset-cacheRemoves cached react-native files (default is false)--reset-cache

Usage with older react-native versions and the Haul bundler

As of react-native-bundle-visualizer version 2.x, the direct output of the Metro bundler is visualized using the source-map-explorer.

Prior to version 2, the Haul bundler was used which used Webpack. If you are having problems visualizing the output for older react-native versions, or you want to explicitly use the Haul bundler, please check out the V1 documentation.

License

MIT

Keywords

react-native-bundle-visualizer

FAQs

Package last updated on 07 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts