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
I have seen where remote bundles you can set up a local port to serve assets from at runtime through a little dev server and then upload to a CDN for production deploy. But is there a good option for if you want a microfrontend to include the assets locally?
The only two things I could come up with are:
Option 1:
Convert it all to base64 blobs and store those in the js code and then use those. These will get bundled with the js bundle as variables.
Option 2:
Setup some build scripting in the host to copy assets from the output folder of microfrontends and move them into a known local path (possibly a folder accessible from an ImageUtil)
Use the ImageUtil.get("MODULENAME_IMAGENAME") to fetch images. This would mean any images in the output folder could be considered "local" and would be bundled from host with the apk.
Ex. ImageUtil.get("myModule_greenLogo.png") would hit the ImageUtil pulling from require("../copiedassets/myModule_greenLogo.png"). Scripting at build time would move the assets from the output of the MyModule microfrontend into the copied assets folder.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I have seen where remote bundles you can set up a local port to serve assets from at runtime through a little dev server and then upload to a CDN for production deploy. But is there a good option for if you want a microfrontend to include the assets locally?
The only two things I could come up with are:
Option 1:
Option 2:
Ex. ImageUtil.get("myModule_greenLogo.png") would hit the ImageUtil pulling from require("../copiedassets/myModule_greenLogo.png"). Scripting at build time would move the assets from the output of the MyModule microfrontend into the copied assets folder.
Beta Was this translation helpful? Give feedback.
All reactions