webworkify-webpack
webworkify-webpack copied to clipboard
Support nested WebWorker
Hi, sometimes we have the need to construct a new Worker inside a Worker that makes them to be nested.
The existing code seems to be assumed to be executed only in the main thread. In order to support constructing a new Worker inside an existing worker, We should avoid using window for pointing to the global object. I replaced it with self so it could be executed under both the main thread and DedicatedWorker.