Expo Optimize - Understanding Assets

Hi! Yesterday I tried the expo optimize -s command for the first time and it worked well. Now my question is regarding assetBundlePatterns and expo build:[android|ios]

Because I asked to save my original images (and then creating .orig.png extension) and that in my app.json file I have "assetBundlePatterns": ["**/*"], does it means that my original images will be included/compiled in my next build (apk, ipa) if I don’t remove them from my folder assets, or the build command only includes/compiles the ones that are required in my code (like when I do require('path/to/image.png'))?


Hey @newfylox,

With asset bundling, any files found under the path value of assetBundlePatterns will be bundled so you’ll want to remove those assets. The second part you are referring to where assets are only picked up if they are explicitly called is how publishing assets are handled.


Thanks for the quick answer. So if I understand, as long as my images fit the assetBundlePatterns path, it will be included in my app (so raising up my app size) even if I don’t use them in my code.

Thanks again!


This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.