Achieving independence with SystemJS
SystemJS is a pluggable module loader that is capable of dealing with a variety of formats. It describes itself as a dynamic ES module loader with extra functionality such as Asynchronous Module Definition (AMD) and import map support, or hooks to introduce, such as a custom resolution mechanism.
Unlike the previously discussed solutions (Module and Native Federation), SystemJS is almost entirely a runtime construct. However, since the runtime construct relies on a certain structure in the code, we might still want to use some tooling for obtaining valid SystemJS modules. For instance, using the webpack bundler, we need to change the output format to system
. Generally, we do not need a bundler at all and could write valid SystemJS modules ourselves, too.
For example, take the following code, which will not be handled by any bundler and could be used directly:
System.register(['react'], function (_export, _context) { ...