You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When placing assets (e.g. PNGs) in a package folder, they don't seem to be bundled correctly on android and are not displayed. iOS and web work flawlessly.
Motivation
If an asset belongs to a feature, I would like to co-locate it with that feature. And not have to place it in both of the apps as a duplicate, if possible.
Additional context
Even though the app.json specifies **/* as a path to bundle assets, android doesn't show anything where the image should be. iOS and web work without any troubles after a rebuild. Throwing the assets into expo/assets works on all three platforms.
It would be great to hear, what the preferred approach for shared assets is with this monorepo-example 🤩
Thanks a lot for any input in advance!
The text was updated successfully, but these errors were encountered:
This is a good question, I'd have to dig a bit deeper into what the best way would be. I'll add an internal task to document this on docs.expo.dev too.
For now, I think it's good to mention a slight behavior change in the classic builds and EAS build (or building it yourself).
assetBundlePatterns was mostly intended to auto-bundle certain assets, even if they aren't imported (dynamically importing - require(\./asset/${dynamic}.png`)` - assets is also not detectable, hence this was created).
With EAS build or building it yourself, any asset file imported through JS (e.g. import './assets/my-image.png') is bundled automatically.
That being said, you should be able to add assets in a workspace package and import it. E.g. with:
If you import the asset within the workspace package, a relative path should work (import './assets/my-image.png')
If you import the asset from another workspace, something like import 'my-pkg/assets/my-image.png' should work too.
Topic and scope of discussion
When placing assets (e.g. PNGs) in a package folder, they don't seem to be bundled correctly on android and are not displayed. iOS and web work flawlessly.
Motivation
If an asset belongs to a feature, I would like to co-locate it with that feature. And not have to place it in both of the apps as a duplicate, if possible.
Additional context
Even though the
app.json
specifies**/*
as a path to bundle assets, android doesn't show anything where the image should be. iOS and web work without any troubles after a rebuild. Throwing the assets intoexpo/assets
works on all three platforms.It would be great to hear, what the preferred approach for shared assets is with this monorepo-example 🤩
Thanks a lot for any input in advance!
The text was updated successfully, but these errors were encountered: