- Change
import-map-overridemeta tag to make it work with SystemJS (more info at import-map-overrides/docs/configuration.md) - Update
single-spaimport to load a SystemJS script
"single-spa": "https://cdn.jsdelivr.net/npm/single-spa@6.0.3/lib/es2015/system/single-spa.min.js",
- Change all scripts tags type to use SystemJS type
<script type="systemjs-importmap"> - Remove the
import-map-injectorscript tags - Load the SystemJS script
<script src="https://cdn.jsdelivr.net/npm/systemjs@6.15.1/dist/system.min.js"></script>
- [Optional] Add the SystemJS extras
<script src="https://cdn.jsdelivr.net/npm/systemjs@6.15.1/dist/extras/amd.min.js"></script>
- Use the
importAPI 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);
},