-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to bundle and embed a dedicated worker which uses libraries in a web application? #189
Comments
This is something I'm still struggling with, good question. Unless Webpack has some smartness to do this magically for us, I think you'll have to have a second build script which creates a bunlde for the worker. Here is an example where you see this in action: https://github.com/josdejong/workerpool/tree/master/examples/embeddedWorker If anyone knows a better/easier way to do bunding and embedding of worker code I would love to hear! |
I am trying to integrate workerpool with a Reactjs app (CRA) but am having quite a few different issues depending on how I try to achieve it. Using it with the Node part is no problem but I think more info is needed on the "browser" side of the repos.
By looking around I found #43 where Jos was kind enough to provide a basic example (https://codesandbox.io/s/xz9jwnyvrw). Issue is, in a real app you probably won't have a simple function placed in index.js that does not need any external librairies
How can I define a seperate worker using its own external librairies and use it in index.js? using
var pool = workerpool.pool('/path/to/worker.js')
thenpool.exec('function')
as suggested in another thread did not workCan workerpool used for the browser only be integrated in the way described here https://github.com/josdejong/workerpool/blob/master/examples/browser?
I would appreciate a realistic example of integrating workerpool with a React app, maybe by updating the codesandbox to use an imported worker with its own librairies?
The text was updated successfully, but these errors were encountered: