Metro Bundler CLI

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

A CLI tool extending the official Metro bundler to enable bundle splitting for React Native applications. Version 1.0.7 uses hash-based module IDs (content + path) for stability across projects, unlike the official incremental IDs or module-name-based approaches. It supports generating base and business bundles to optimize loading times. Stable module IDs are optional (use-stable-id flag). The tool is primarily for advanced React Native developers needing code splitting beyond Metro's defaults. No regular release cadence; appears maintained but not actively updated.

error Error: Cannot find module 'metro-bundler-cli'
cause Package not installed globally or locally.
fix
Run: npm install -g metro-bundler-cli or npm install --save metro-bundler-cli
error Unknown option: --use-stable-id
cause Using an older version of the package that doesn't support this flag.
fix
Update to the latest version: npm update -g metro-bundler-cli
gotcha Stable module ID is not the default behavior; you must explicitly set --use-stable-id true.
fix Add --use-stable-id true to the CLI command.
deprecated Package has not been updated since 2018; may not be compatible with newer React Native or Metro versions.
fix Consider using Metro's built-in bundle splitting or other maintained alternatives.
npm install metro-bundler-cli
yarn add metro-bundler-cli
pnpm add metro-bundler-cli

Shows how to generate a business bundle excluding a base bundle manifest, using stable IDs.

npx 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/business.manifest.json --exclude dist/base.manifest.json