manfredsteyer / multi-framework-micro-frontend

77 stars 36 forks source link

Dynamic loading remote from web-component #2

Open floflojaja opened 3 years ago

floflojaja commented 3 years ago

Hi,

I'm currently work arround module federation and a microfrontend architecture. this repository have given me a really valuable help for my project.

Now i meet a problem when i want to load remote dynamically. In fact, your plugin (module-federation-plugin) allow us to load module but not web-component like when you expoded the "bootstrap.ts" file. When i try to retrieve the "./web-components" element from the container like this :

const container = window[remoteName]; const factory = await container.get(exposedElement); const Element = factory(); console.log(Element)

It is empty...

So you have an idea to solve this problem ?

Thanks