module-federation-repack
module-federation-repack copied to clipboard
Module Federation example using Webpack and Re.Pack for React Native
Installation
yarn --cwd app1 && yarn --cwd app2 && yarn --cwd host
Usage
Running app 1 container
App can be run as a standalone application using:
-
STANDALONE=1 yarn --cwd app1 start
(notice the dev server is running on port 9000) -
yarn --cwd app1 ios
/yarn --cwd app1 android
Or as part of a Host application.
Running app 2 container
App can be run as a standalone application using:
-
STANDALONE=1 yarn --cwd app2 start
(notice the dev server is running on port 9001) -
yarn --cwd app2 ios
/yarn --cwd app2 android
Or as part of a Host application.
Running host application with app containers
- Run dev server for app 1 container:
yarn --cwd app1 start
- Run dev server for app 2 container:
yarn --cwd app2 start
- Run dev server for host application:
yarn --cwd host start
- Build host application:
yarn --cwd host ios
/yarn --cwd host android
Notes
It might be helpful to open Re.Pack's web dashboard to analyse artifacts:
- http://localhost:9000/dashboard for app1 container
- http://localhost:9001/dashboard for app2 container
- http://localhost:8081/dashboard for host container