Skip to content

Files

Latest commit

Nov 14, 2024
908450d · Nov 14, 2024

History

History

react-sharedworker

README.md

react-sharedworker

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.

How to run

yarn
yarn start:module
yarn start:host

Open browser and observe error in console.

shared worker

How to work

  1. Use SharedWorker instead of Worker in host application
  2. Dynamically import bootstrap file in worker thread
  3. Use promise based dynamic remotes host/webpack.host-config.js
  4. Use multiple entry points in webpack config module/webpack.module-config.js