Skip to main content
The expo export command generates optimized production bundles of your app, creating static files ready for deployment to hosting services or over-the-air (OTA) updates.

Usage

Arguments

string
Directory of the Expo project. Defaults to the current working directory.

Options

Output Options

string
The directory to export static files to. Default: dist
string[]
Platforms to export. Options: android, ios, web, all. Default: all. Alias: -p

Build Options

boolean
Configure static files for developing locally using a non-https server. Disables optimizations.
boolean
Prevent minifying JavaScript source code.
boolean
Prevent generating Hermes bytecode for Android. Keeps JavaScript in text format.

Bundler Options

boolean
Clear the Metro bundler cache before exporting. Alias: -c, --reset-cache
number
Maximum number of tasks to allow the bundler to spawn. Controls parallelization.

Source Maps

string | boolean
Emit JavaScript source maps. Alias: -sOptions:
  • true - Generate source maps
  • false - No source maps (default)
  • inline - Inline source maps in bundle
  • external - Generate separate .map files

Web-Specific Options

boolean
Skip exporting static HTML files and only export API routes for web. Alias: --api-only
boolean
Emit an asset map JSON file for further processing.

What Gets Exported

The export command creates:
  • JavaScript bundles - Optimized, minified code for each platform
  • Assets - Images, fonts, and other static files
  • Metadata - Asset manifests and configuration
  • Source maps - Debug information (if enabled)
  • HTML files - Static web pages (for web platform)

Examples

Basic Export

Export for all platforms:
Creates dist/ directory with:

Specific Platform

Export only for Android:
Export for iOS and Android only:

Custom Output Directory

Export to a specific directory:

Clear Cache First

Ensure fresh build:

With Source Maps

Generate source maps for debugging:
Or specify source map type:

Development Export

Create unoptimized bundles for testing:
This skips:
  • Minification
  • Bytecode compilation
  • Production optimizations

Web API Routes Only

Export only API routes without static HTML:
Useful for:
  • Server-side API deployment
  • Serverless functions
  • Backend-only exports

Without Bytecode

Skip Hermes bytecode compilation:
Keeps JavaScript in readable format for debugging.

Control Workers

Limit CPU usage during export:

Platform-Specific Exports

iOS Export

Generates:
  • iOS-specific JavaScript bundle
  • Universal assets (images, fonts)
  • Metadata for iOS runtime
Used for:
  • OTA updates with expo-updates
  • Embedding in iOS binary
  • EAS Update deployments

Android Export

Generates:
  • Android-specific JavaScript bundle
  • Hermes bytecode (unless --no-bytecode)
  • Universal assets
  • Metadata for Android runtime
Used for:
  • OTA updates with expo-updates
  • Embedding in APK/AAB
  • EAS Update deployments

Web Export

Generates:
  • Web-optimized JavaScript bundles
  • Static HTML files
  • Progressive Web App manifest
  • Service worker (if configured)
  • Web assets
Used for:
  • Static site hosting
  • CDN deployment
  • Server-side rendering

Output Structure

Native Platforms (iOS/Android)

Web Platform

Deployment

Hosting Static Web

After exporting for web, deploy to: Vercel:
Netlify:
GitHub Pages:

OTA Updates

Use with expo-updates for over-the-air updates:
Or use EAS Update:

Embedding in Native Apps

Export and embed in native builds:

Asset Optimization

Automatic Optimizations

Expo export automatically:
  • Compresses images
  • Minifies JavaScript
  • Tree-shakes unused code
  • Content-hashes filenames
  • Generates multiple resolutions for images

Asset Map

Generate asset map for custom processing:
Creates assetmap.json:

Source Maps

Why Use Source Maps

Source maps help you:
  • Debug production issues
  • Get readable stack traces
  • Map minified code to source
  • Use error reporting tools

Generating Source Maps

Uploading to Error Services

Upload source maps to services like Sentry:

Hermes Bytecode

What is Hermes Bytecode

Hermes bytecode is a binary format that:
  • Reduces app startup time
  • Decreases bundle size
  • Improves performance on Android

Disabling Bytecode

For debugging or compatibility:

Enabling on iOS

Configure in app.json:

Server-Side Generation (SSG)

Static Site Generation

For web, Expo exports static HTML:
Each route becomes an HTML file:

Disabling SSG

Export only client-side JavaScript:

API Routes

API routes are exported as serverless functions:

Troubleshooting

Export Fails

Clear cache and retry:

Bundle Size Too Large

Analyze bundle size:
Reduce size by:
  • Removing unused dependencies
  • Using dynamic imports
  • Optimizing images
  • Enabling Hermes bytecode

Missing Assets

Ensure assets are properly referenced:

Source Maps Not Working

Verify source maps are generated:

Hermes Bytecode Issues

Disable if encountering errors:
Or check Hermes compatibility of dependencies.

Best Practices

Version Control

Don’t commit dist/ directory:

CI/CD

Automate exports in CI:

Multiple Environments

Use environment variables:

Testing Exports

Test exported bundles locally:

Performance Tips

  • Use --max-workers to control CPU usage
  • Enable Hermes bytecode for faster startup
  • Optimize images before importing
  • Use dynamic imports for code splitting
  • Enable source maps only when needed