Providing remote entry URLs based on the environment at runtime? #6999
Replies: 4 comments 2 replies
-
Just following up again on this as this is likely one of the last deciding factors for us to move forward with modern.js. Thank you!! |
Beta Was this translation helpful? Give feedback.
-
@zllkjc apologies - don't want to bug you but I'm wondering if you have any thoughts on how to address this problem? Is there any way we can provide URLs at runtime? We need to specify the URLs depending on the environment. I haven't been able to solve this yet. For additional context, in a previous non-modern.js proof of concept we had utilized this plugin https://www.npmjs.com/package/external-remotes-plugin -- hoping to do something similar here if it all possible |
Beta Was this translation helpful? Give feedback.
-
Sorry for miss this disscussion. In my opinion, this part is depends on module federation, not modern.js. mf manifest.json may not support this. |
Beta Was this translation helpful? Give feedback.
-
But seems a interesting feature. Let me invite @2heal1 discuss together! |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Currently, I am providing my remote URLs to modern.js and they are being built into the bundle like so at build time:
I am wondering if it is possible to inject these values at runtime via a global object defined on the window (or some other way that makes sense).
I want to be able to do something like this: (although currently getting 'window is not defined'.)
The problem I am looking to solve to move forward with this framework is to be able to build once and deploy the same bundle to many different environments (testing, dev, etc). The configuration.js file in the window scope would be dynamically created which sets the values like DESIGN_SYSTEM_PROD_URL.
Have you come across this before and can you provide any insight or help on how to solve this problem? Maybe there's a better way to do it than what I've suggested.
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions