-
Let's say i have a host app , a mini app , how can i access functions/variables inside host app from mini app , by adding exposes inside host's ModuleFederationPlugin , then call Federated.importModule('host', 'xxx') inside mini app ? i tried this but end up with : [ScriptManager] Failed while resolving script locator: {"caller": undefined, "scriptId": "FastInspection"} {"originalError": [TypeError: resolver is not a function (it is undefined)]} Global variable can work but i don't want to put everything inside global variable |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
It's seems like if i shared through Host's ModuleFederationPlugin.exposes , it's actually a individual script context , the value i assigned in host becomes null in miniApp. So what's the right way to do this ? through global variable ? |
Beta Was this translation helpful? Give feedback.
you can do this through:
I'm not sure there is a proper example for that,
repack-examples
repo needs an overhaul and is largely outdated. You can also check out https://github.com/callstack/super-app-showcase for some inspiration but I'm not sure there is a bidirectional flow that includes this case.