https://github.com/unadlib/webpack-mf-workers
Using Webpack Module Federation in SharedWorker
https://github.com/unadlib/webpack-mf-workers
Last synced: 5 months ago
JSON representation
Using Webpack Module Federation in SharedWorker
- Host: GitHub
- URL: https://github.com/unadlib/webpack-mf-workers
- Owner: unadlib
- License: mit
- Created: 2024-10-28T17:39:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-30T09:50:38.000Z (over 1 year ago)
- Last Synced: 2025-10-26T08:35:06.403Z (8 months ago)
- Language: JavaScript
- Size: 431 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# webpack-mf-workers
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](http://localhost:3000) and observe error in console.

## How to fix
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`