Let's say I manage 2 JavaScript projects both built with Webpack:
- A Website called User-Website
- A JavaScript module called External-Module
Note that I'm using 2 separate projets for the same reasons described by the Micro Front end architecture.
I want my User-Website to be able to dynamically load External-Module on demand (using any JavaScript module technology). My User-Website knows at build-time the URL where to reach External-Module.
I can chose whatever technology is needed on both User-Website and External-Module.
I'm looking for a solution:
- That is easy to implement (maybe JSONP that Webpack already handles to dynamically load chunks?)
- That doesn't add to much overhead on both User-Website and External-Module (For example JavaScript modules looks good but requires a lot of polyfilling)
My question is related to https://github.com/webpack/webpack/issues/7526
I tried to use JSONP library output on my External-Module but I don't know how to load it in User-Website.
I'm also thinking about using the SystemJS in User-Website to dynamically load External-Module: