This is a very simple micro frontend proof of concept using three create-react-apps and single-spa. This is by no means production ready.
The changes I made were heavily influenced by this post by Łukasz Kyć at Pragmatists. If you want more detail about what I'm doing here, you are better off checking out his post. I made a few adjustments from what he talks about, but the important changes are in the webpack.config.prod.js
file to work with react-scripts
version 2.0.4. I'm also using a seperate entry point file (singleSpa.js
) instead of overwriting index.js
. This allows us to run the app on localhost while developing (or should... that's the idea anyway, I haven't actually tried it).
I'll let the commits do the rest of the talking for me.
To run this:
- Run
yarn install
within each app directory - In three seperate terminal windows run the following:
- Run
yarn serve
insidechild-one
- Run
yarn serve
insidechild-two
- Run
yarn start
insideparent
- Run
Additional Resources: