- ReactJS
- (single-spa)[https://single-spa.js.org/]
- (SystemJS)[https://github.com/systemjs/systemjs]
- webpack, babel
- TypeScript
- eslint, prettier
Important notes regarding the importmap file.
- mf-config contains
importmap.js
which describes import paths for all microservices - it is bundled into the
dist
folder for each build - it should point to the proper resource relative to the service name
- Run locally all services:
npm install
for each servicenpm start
for mf-config service (root service)importMapOverrides.enableUI()
in the dev-tools console to enable import maps override UI- open override UI and apply override for the service you want to run locally. E.g. for mf-main:
- Deploy to an environment and run locally only chosen services:
- single-spa team recommends deploying an application to some dev environment, and apply overrides for one service at a time there
- in case of AWS (S3 solution):
- create S3 buckets for each service
npm run build
for each service- upload build assets to your buckets
- make all uploaded files public
- enable static website hosting for each bucket
- follow instructions below to handle possible CORS issues
- enable import maps override UI and apply override for any service of your choice (refer to p.1 above)
- Add proper CORS policies on the server side. E.g. AWS S3 bucket working as a static website hosting:
- go to permissions
- scroll to "Cross-origin resource sharing (CORS)"
- apply your policy:
[
{
"AllowedHeaders": [
"*"
],
"AllowedMethods": [
"GET"
],
"AllowedOrigins": [
"http://<your_local_ip_address>" // not 'localhost'
],
"ExposeHeaders": []
}
]
- Since recently, browsers comply with the "Private Network Access" specification. To avoid that:
- pls refer to the official announcement
- this solution will work, but should be considered as insecure