So the exposes property has some properties like give each module a public name, like tracking system or data, and a local name, which is like where you module is on the disk currently from this bit, and to each module supported, can be just a normal ECMAScript module, could be common JS module, could be CSS, could be anything processed by loaders, whatever.
And to consume other containers and you have to use the remotes key, or remote properties in the modules federation plugin, and here you give each container a name like analytics, and all the point to a container location which is then loaded at one time, here it would load the analytics JS script at one time.
To use these remote modules from containers, you would just have an import statement with analytics, is previous with analytics, and then the public name of the module in the container, the exposed module in the container, here, tracking system. Yeah.
And to share modules, you have the shared property. And in this shared property, you just list all the modules you want to have, want to be able to share between other containers or other applications. Like an example here, react-virtualize-shared, but also react-virtualize-the-styles of react-virtualize. And there's also advanced configuration available. Here, an example is a react, must only be a log instantiated once at an HTML page. So you can use a single advanced configuration to make sure react is only your loaded once. For each shared module, Webex will figure out which version is provided by looking up the version information from the package.json, but also would look up the required version for each dependency by looking in your package.json dependencies list or a depth dependencies list. And yeah, but you could also use more advanced configuration to override this or pass other things or define fallback modules, define different keys as also advance configuration for container building and also for consuming containers available. If you're interested, pause video and look in the details.
Comments