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:
diststring[]
Platforms to export. Options:
android, ios, web, all. Default: all. Alias: -pBuild 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-cachenumber
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 mapsfalse- No source maps (default)inline- Inline source maps in bundleexternal- Generate separate .map files
Web-Specific Options
boolean
Skip exporting static HTML files and only export API routes for web. Alias:
--api-onlyboolean
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:dist/ directory with:
Specific Platform
Export only for Android:Custom Output Directory
Export to a specific directory:Clear Cache First
Ensure fresh build:With Source Maps
Generate source maps for debugging:Development Export
Create unoptimized bundles for testing:- Minification
- Bytecode compilation
- Production optimizations
Web API Routes Only
Export only API routes without static HTML:- Server-side API deployment
- Serverless functions
- Backend-only exports
Without Bytecode
Skip Hermes bytecode compilation:Control Workers
Limit CPU usage during export:Platform-Specific Exports
iOS Export
- iOS-specific JavaScript bundle
- Universal assets (images, fonts)
- Metadata for iOS runtime
- OTA updates with expo-updates
- Embedding in iOS binary
- EAS Update deployments
Android Export
- Android-specific JavaScript bundle
- Hermes bytecode (unless
--no-bytecode) - Universal assets
- Metadata for Android runtime
- OTA updates with expo-updates
- Embedding in APK/AAB
- EAS Update deployments
Web Export
- Web-optimized JavaScript bundles
- Static HTML files
- Progressive Web App manifest
- Service worker (if configured)
- Web assets
- 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:OTA Updates
Use with expo-updates for over-the-air updates: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: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: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:- 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:Best Practices
Version Control
Don’t commitdist/ directory:
CI/CD
Automate exports in CI:Multiple Environments
Use environment variables:Testing Exports
Test exported bundles locally:Performance Tips
- Use
--max-workersto 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