Using Webpack Module Federation in SharedWorker
Federated module (defined under module
folder), can be consumed by main thread in host application (defined under host
folder), and it also can be consumed by worker thread.
yarn
yarn start:module
yarn start:host
Open browser and observe error in console.
- Use SharedWorker instead of Worker in host application
- Dynamically import bootstrap file in worker thread
- Use promise based dynamic remotes
host/webpack.host-config.js
- Use multiple entry points in webpack config
module/webpack.module-config.js