Skip to content

Commit

Permalink
Full support for ESM in root configs. Resolves #418 (#419)
Browse files Browse the repository at this point in the history
* Full support for ESM in root configs. Resolves #418

* Changeset
  • Loading branch information
joeldenning authored Nov 8, 2024
1 parent 97b2f42 commit 56da695
Show file tree
Hide file tree
Showing 6 changed files with 453 additions and 85 deletions.
5 changes: 5 additions & 0 deletions .changeset/seven-ants-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"generator-single-spa": patch
---

Load layout root config microfrontends with browser rather than SystemJS
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ module.exports = class SingleSpaRootConfigGenerator extends PnpmGenerator {
);

this.fs.copyTpl(
this.templatePath(`${parentPath}/index.ejs`),
this.templatePath(`src/index.ejs`),
this.destinationPath(`src/index.ejs`),
this.options,
{ delimiter: "?" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
<script type="injector-importmap">
{
"imports": {
"@<?- orgName ?>/root-config": "//localhost:9000/<?- orgName ?>-root-config.js"
"@<?- orgName ?>/root-config": "//localhost:9000/<?- orgName ?>-root-config.js",
"@single-spa/welcome": "https://cdn.jsdelivr.net/npm/single-spa-welcome/dist/single-spa-welcome.min.js"
}
}
</script>
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const routes = constructRoutes(microfrontendLayout);
const applications = constructApplications({
routes,
loadApp({ name }) {
return System.import(name);
return import(/* webpackIgnore: true */ name);
},
});
const layoutEngine = constructLayoutEngine({ routes, applications });
Expand Down
Loading

0 comments on commit 56da695

Please sign in to comment.