This project is a proof of concept showcasing the Micro Frontend concept through React. For CSS, this is using Tailwind CSS.
The container-react serves as the shell React application, consuming micro frontends from the microapps folder.
Webpack Module Federation is utilized for exposing and consuming remote applications.
Additionally, there's a configuration to export microapps artifacts in JSON format, enabling consumption by server-side rendered web applications like ColdFusion, Lucee, ASP.Net, JSP etc. To render the microapps, the {{microapp}}.json file is read in the existing page, loading JS/CSS artifacts using the JSON.
- Go to the microapps folder: > cd microapps
- Run: > npm run start
- Go the the container-react folder: > cd ../container-react
- Run: _> npm run
- Go to the microapps folder: > cd microapps
- Run: > npm run build:{{microapp}}:json
- Go to the microapps/dist/{{microapp}} folder and you can find all the artifacts for the microapp.
- Read the {{microapp}}.json file inside your cfml/asp/jsp pages and load all the JS/CSS files.
- Make sure that you have the root element for the microapp in the document for the app to load.