This repository has been archived by the owner on Sep 9, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 273
[feat] support load plain worker module in another worker #320
Comments
JounQin
added a commit
to JounQin/test
that referenced
this issue
Jun 15, 2021
@JounQin Why do you use |
@alexander-akait Oh, sorry, I didn't notice the native worker support in webpack v5, but using const aWorker = new Worker(new URL('./a.worker', import.meta.url))
// vs
import AWorker from './a.worker'
const aWorker = new AWorker() |
@JounQin Yep, worker-loader should work, but here some limitations - cache will not work as expected and some features is not available |
That's why I'm asking for this feature here, if it's not possible to support it, feel free to close, I'll continue to use my current workaround as above. |
@JounQin There is solution for webpack v4 https://github.com/GoogleChromeLabs/worker-plugin, it should be better than this loader (also it will be deprecated in near future) |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Feature Proposal
excludeImportee
option to exclude worker be loaded as webpack WebWorkerFeature Use Case
If 'b.worker.js' imports 'a.worker.js' to reuse some of its logic, it will just throw errors
https://github.com/JounQin/test/blob/worker-loader/src/b.worker.js
Please check https://github.com/JounQin/test/blob/worker-loader for example.
Workaround:
exclude
a.worker.js
fromworker-loader
, and useworker-loader!./a.worker
instead.The text was updated successfully, but these errors were encountered: