andywer / threads.js

🧵 Make web workers & worker threads as simple as a function call.
https://threads.js.org/
MIT License
3.04k stars 161 forks source link

Inject full path to Worker where it used, not where declared #486

Open javeoff opened 8 months ago

javeoff commented 8 months ago

My package creates an instance of Worker, and my main nodejs esm application cannot inject the file, because full path is based on my package. I can create PR with process.cwd optional support in the options. Or do you can explain how can I solve the problem?

https://github.com/andywer/threads.js/blob/0d1a882f09273cb8482902ae2601fe4ffed6fbab/src/master/implementation.node.ts#L82