-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
Description
Looks like I've solved most of the issues, the trick was to explicitly supply a true worker path as `__webpack_public_path__` and `__webpack_require__.p` inside the worker. Still needs a small blob helper to overcome the same-origin policy.
What's supported:
- cross-domain worker
- no worker loader
- sourcemaps
- dynamic
import()of images and anything else
https://github.com/kirill-konshin/cross-domain-worker/blob/main/packages/cross-domain-worker/src/index.js I have published the NPM package cross-domain-worker since the solution is quite reusable.
https://github.com/kirill-konshin/cross-domain-worker/blob/main/packages/host/src/index.js usage in main thread.
https://github.com/kirill-konshin/cross-domain-worker/blob/main/packages/worker/src/worker.js usage in worker.
Originally posted by @kirill-konshin in webpack/webpack#16696 (comment)