- Change
import-map-override
meta tag to make it work with SystemJS (more info at import-map-overrides/docs/configuration.md) - Update
single-spa
import to load a SystemJS script
"single-spa": "https://cdn.jsdelivr.net/npm/[email protected]/lib/es2015/system/single-spa.min.js",
- Change all scripts tags type to use SystemJS type
<script type="systemjs-importmap">
- Remove the
import-map-injector
script tags - Load the SystemJS script
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/system.min.js"></script>
- [Optional] Add the SystemJS extras
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/extras/amd.min.js"></script>
- Use the
import
API via SystemJS standard with:
<script>
System.import('@org/root-config');
</script>
For a full example, take a look at index.sample.ejs
According new changes, you have to configure SingleSPA Webpack Defaults
to output your code in SystemJS format
const defaultConfig = singleSpaDefaults({
orgName,
projectName: "root-config",
webpackConfigEnv,
argv,
disableHtmlGeneration: true,
outputSystemJS: true,
});
Ensure that root config
will load apps using SystemJS import API
loadApp({ name }) {
return System.import(name);
},