metro-bundler

Configure Metro bundler for React Native projects via metro.config.js.

156|21|Updated Oct 25, 2025
One-click install
npx skills add https://github.com/anton-abyzov/specweave --skill metro-bundler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: metro-bundler
Source: https://github.com/anton-abyzov/specweave/tree/main/plugins/specweave-mobile/skills/metro-bundler
Command: npx skills add https://github.com/anton-abyzov/specweave --skill metro-bundler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

In-depth expertise on Metro bundler configuration, caching, custom transformers, and performance optimizations for React Native apps.

Core Features & Use Cases

  • Configure transformer, resolver, and server options for fast builds
  • Inline requires, asset management, and custom transformers
  • Advanced performance optimizations and debugging tips

Quick Start

Edit metro.config.js to enable inlineRequires and cache resets, then start the dev server.

Frequently Asked Questions about metro-bundler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I optimize Metro bundler performance for React Native development?

Metro bundler performance improves through metro.config.js customization: enable inlineRequires to reduce bundle size, configure transformer and resolver options for faster builds, implement caching strategies, and use resetCache when needed. These adjustments directly speed up development cycles.

How do I resolve module errors in Metro bundler?

Module resolution errors stem from incorrect sourceExts, assetExts, or watchFolders configuration. Configure platform extensions, verify asset extensions match your project structure, and adjust watchFolders to include monorepo paths. Metro then locates dependencies correctly.

Can I use custom transformers like SVG in Metro?

Yes, Metro supports custom transformers in metro.config.js. Define transformer rules for specific file types—SVG transformers convert vector assets during bundling. Pair this with assetExts configuration to handle asset processing.

What's the best way to configure Metro for monorepo projects?

Monorepo Metro setup requires watchFolders to specify workspace directories and resolver configuration to handle cross-package imports. Use mergeConfig to combine custom settings with Metro defaults, enabling bundler awareness of all project packages.

How do I reset Metro cache and change the dev server port?

Add resetCache: true to metro.config.js to clear cached bundles, and configure the server port through server options—default is 8081. Restart the bundler after changes to apply new cache and port settings.

Why should I use inlineRequires and bundle splitting in Metro?

inlineRequires eliminates unused code at bundle time, reducing app size. Bundle splitting divides code into smaller chunks for faster loading. Both techniques are Metro optimization strategies that improve React Native app startup performance.