HomeGuidesReferenceLearn

Asset selection and exclusion

Select which assets should be included in updates.


Available for SDK 50 and above (expo-updates >= 0.23.0).

In SDK 49 and earlier, all assets resolved in the Metro bundler are included in every update and are uploaded to the update server. The new experimental asset selection feature in SDK 50 allows the developer to specify that only certain assets should be included in updates. This can greatly reduce the number of assets that need to be uploaded to and downloaded from the updates server. This feature will work with the EAS Update server or any custom server that complies with the expo-updates protocol.

To use this feature, include the new property extra.updates.assetPatternsToBeBundled in your app config. It should define one or more file-matching patterns (regular expressions). For example, suppose your app.json file has the patterns defined this way:

app.json
  "expo": {
    %%placeholder-start%%... your existing configuration %%placeholder-end%%
    "extra": {
      "updates": {
        "assetPatternsToBeBundled": [
          "app/images/**/*.png"
        ]
      }
    }
  }

In this case, all .png files in all subdirectories of app/images will be included in updates.

If this new property is not in your app config, all assets resolved by the bundler will be included in updates (as per SDK 49 and earlier behavior).

Verifying that an update includes all required app assets

When using this feature, assets that do not match any file patterns will resolve in the Metro bundler. However, these assets will not be uploaded to the updates server. You have to be certain that assets not included in updates are built into the native build of the app.

If you are building your app locally or have access to the correct build for publishing updates (with the same runtime version), then you can use the npx expo-updates assets:verify command. It allows you to check whether all required assets will be included when you publish an update:

Terminal
npx expo-updates assets:verify <dir>
This new command is part of the expo-updates CLI, which also supports EAS Update code signing. It is not part of the Expo CLI or the EAS CLI. It is available for (expo-updates >= 0.24.10).

You can also use --help with the command to see the available options:

Options
  <dir>                                  Directory of the Expo project. Default: Current working directory
  -a, --asset-map-path <path>            Path to the `assetmap.json` in an export produced by the command `npx expo export --dump-assetmap`
  -e, --exported-manifest-path <path>    Path to the `metadata.json` in an export produced by the command `npx expo export --dump-assetmap`
  -b, --build-manifest-path <path>       Path to the `app.manifest` file created by expo-updates in an Expo application build (either ios or android)
  -p, --platform <platform>              Options: ["android","ios"]
  -h, --help                             Usage info

Example

Working example

See a working example on using asset selection, the assets:verify CLI command, and other EAS update features.