metro-bundler-cli

raw JSON →
1.0.7 verified Sat Apr 25 auth: no javascript maintenance

A CLI tool that extends the official React Native Metro bundler to support stable module IDs and bundle splitting. Version 1.0.7 provides hash-based module IDs (content + path) for more stable splits compared to incremental IDs or project-name-based approaches. Enables splitting into base and business bundles to reduce download/load times. Last release date unknown; appears to be in maintenance mode. Key differentiators: uses content hash for module IDs, avoids reliance on project name, and provides manifest-output and exclude options for split bundling.

error Error: Cannot find module 'metro'
cause metro-bundler-cli expects metro to be installed as a peer dependency.
fix
Install react-native or metro manually: npm install --save-dev metro
error Error: --use-stable-id flag not recognized
cause The flag must be used with the bundled command; verify CLI version.
fix
Ensure you are using the global installed metro-bundler-cli (not metro directly).
gotcha Stable IDs are not the default; must explicitly pass --use-stable-id true to enable hash-based module IDs.
fix Add --use-stable-id true to your bundle command.
gotcha This tool is a thin wrapper over metro bundler; metro must be installed and configured in your project.
fix Ensure react-native (which includes metro) is installed as a devDependency.
deprecated The package is no longer actively maintained; check for alternatives or use with caution.
fix Consider migrating to a maintained bundler solution.
npm install rn-bundler
yarn add rn-bundler
pnpm add rn-bundler

Shows how to bundle a React Native project with stable module IDs using the metro-bundler-cli CLI tool.

// Install: npm install --global metro-bundler-cli
// Then run:
metro-bundler bundle \
  --entry-file index.js \
  --bundle-output dist/business.jsbundle \
  --assets-dest dist \
  --platform ios \
  --dev false \
  --use-stable-id true \
  --manifest-output dist/manifest.json