Skip to content

rn-size-check v0.2.0: which npm package makes your app big

Choose a tag to compare

@MuhammadHamza47 MuhammadHamza47 released this 16 Oct 07:34
· 20 commits to main since this release

Which npm packages make the JS bundle big? Point the tool at your React Native project, or drop the source maps on the website:

npx rn-size-check app-release.apk --project .
  • npm package breakdown of the JS bundle from React Native's own Gradle source maps, in real Hermes bytecode bytes (each position in the composed map is a byte offset in the bytecode). Also shows your app code, JSON compiled into the bundle, and Hermes's string and data tables.
  • The maps are checked against the build: a map from a different build, or a Hermes map with a plain JS bundle, is refused with a clear message instead of showing wrong numbers.
  • Lottie animations the code require()s are now found (from the packager map), with an estimate of their download cost.
  • Exact unused fonts: with a map, font-weights and icon-fonts report exactly which files no code references, with exact savings.
  • New checks (need a map): heavy-package (moment, lodash, big icon libraries), duplicate-packages (one package bundled in two versions), duplicate-modules (the same file bundled twice under different paths), font-name-case (a fontFamily that differs from the font file only in letter case, which Android won't find).
  • New flags: --project <dir> and --sourcemap <file>. The website accepts .map files dropped with the build, or added afterwards.
  • Markdown summary includes the top packages.
  • Package advice looks at the rest of the bundle: moment next to date-fns says to move to date-fns; a package your code never imports (only another dependency does) is shown as info, with npm ls advice instead of import tips.
  • Fonts in res/font (Android resources used by native libraries) are never reported as unused; only assets/fonts is judged against the JS code.
npx rn-size-check@latest android/app/build/outputs/bundle/release/app-release.aab

📦 npm: https://www.npmjs.com/package/rn-size-check · 🌐 Web: https://rn-size-check-web.vercel.app