Hi everyone!
I’m building an application, using a micro frontend approach, inside a monorepo using SingleSPA and lazy loading the bundles with SystemJS.
When I put this snippet into the index.html it works locally, because I’m serving each micro-frontend in a specific port. In this case for example, the root is served on 4200 and the “child” module is on 8001.
<script type="systemjs-importmap">
{
"imports": {
"@organization/my-module": "http://localhost:8001/my-module/index.singlespa.js",
"@organization/root": "/index.root.js"
}
}
</script>
When I deploy it, it tries to access the localhost on my machine. I tried changing it to http://my-module.com/my-module/index.singlespa.js, but what I get back is just my index.html, so the bundle loading fails.
I’m considering this simple example as a start to build an application with many co-existent applications, first creating them internally as monorepos and then, as our teams grows, extracting some of them to our private repo.
Any ideas to solve this?