callstack / super-app-showcase

Monorepository template for super app development with React Native and Re.Pack
MIT License
382 stars 63 forks source link

How do I generate mini-app bundles and serve them via CDN to my host? #80

Closed DivyatejaChe closed 4 months ago

DivyatejaChe commented 4 months ago

Ask your Question

To enable super-app development, I have setup a monorepo with PNPM and configured Re.Pack. The app works fine when running on the localhost - bundles being served from localhost.

When I attempt to generate mini-app-specific bundles and serve them via CDN, it fails to load on my host application.

Please help me with the following questions and understand this is time critical for me.

How do I generate mini-app bundles? How do I serve the mini-app bundles from a server (like a CDN) other than localhost? What changes do I need to make in my host application to read bundles from the CDN? (ScriptManager.script.addResolver() etc)

[GITHUB Repo link]() [CDN URL]()

jbroma commented 4 months ago

Hey @DivyatejaChe,

After looking at the the repository, I can see that the address for the auth module is hardcoded, you should change it to https://cdn.jsdelivr.net/gh/DivyatejaChe/df-repack@1629c48afc875fe2afb72e251f5d24c6b9cd6c66/[name][ext]. Try changing it and see if that helps, because I believe RePack takes your URL and tries to concatenate the last part again, resulting in wrong URL

DivyatejaChe commented 4 months ago

Thank you @jbroma that fix worked! 👏🏻