Warning: This plugin requires Expo SDK 53 or higher to work
🚀 Drastically speed up your npx expo run:[android|ios] builds!
This plugin adds local disk caching for Expo builds (and the EAS Cache Provider).
If a matching cached build exists, it launches instantly, letting you skip the often time-consuming compilation step entirely.
Uses Expo fingerprint (a hash of your native project and dependencies) for intelligent invalidation, building fresh only when needed.
Can be combined with remote caching providers like EAS (this will cache downloaded builds).
- Getting Started
- Optional Configuration
- Default Configuration
- Combine with EAS Build Cache Provider (Recommended Setup)
- Using a Cloud-Synced Folder for Cache (Not Recommended)
- Acknowledgments
-
Install it as a dev dependency:
npm install --save-dev expo-build-disk-cache
-
Add it to your app config (still experimental):
{ "experiments": { "buildCacheProvider": { "plugin": "expo-build-disk-cache" } } }
You can configure the plugin in a few ways:
-
Option A: In App Config
Add the following to yourapp.json
orapp.config.js
: [HINT:] Keep in mind any change here will result in a different fingerprint -> needs rebuilding{ "experiments": { "buildCacheProvider": { "plugin": "expo-build-disk-cache", "options": { "cacheDir": "~/expo-build-disk-cache/" } } } }
-
Option B: In a Separate Config File
Create adisk-cache.json
file in your project or home directory. This allows per-machine customization without affecting the fingerprint and can be added to.gitignore
. The config file merges with the app config and overrides conflicting settings. Also supports the platform specific config folder by using env-paths.{ "cacheDir": "~/expo-build-disk-cache/", "cacheGcTimeDays": 21 }
-
Option C: In package.json
{ "disk-cache": { "cacheDir": "~/expo-build-disk-cache/", "cacheGcTimeDays": 21 } }
-
cacheDir
: Defaults to a temporary directory in the system's temp folder. (good alternative:~/expo-build-disk-cache/
). -
remotePlugin
: [Optional] Set toeas
to use the EAS remote build cache provider. You can also any other build cache provider. -
remoteOptions
: [Optional] Options for the remote build cache provider. This is a object that will be passed to the remote build cache provider. (Not needed for eas but other providers may need it) -
cacheGcTimeDays
: Defaults to 7 days; files will be deleted if not used within this period. Set to-1
to prevent deletion. -
debug
: Defaults tofalse
. Set totrue
for verbose logging -
enable
: Defaults totrue
. Set tofalse
to disable the plugin.
For a complete list of available configuration options, refer to the source configuration file.
Add remotePlugin
to your configuration to use the EAS remote build cache provider. This will combine both Providers. This caches downloaded builds from EAS and local builds. This is the recommended way to use this plugin.
{
"experiments": {
"buildCacheProvider": {
"plugin": "expo-build-disk-cache",
"options": {
"remotePlugin": "eas",
"cacheDir": "~/expo-build-disk-cache/"
}
}
}
}
To share the build cache across multiple machines, set cacheDir
to a folder synced with a cloud service (e.g., Dropbox, Google Drive, OneDrive). This is beneficial for small teams or individuals who want to speed up their builds without setting up a dedicated server. Larger teams or organizations may want to consider a solution with server for caching.
Special thanks to Expo for making this possible and for their overall great software.