How to add worker thread in Electron JS?

Viewed 476

How do we add worker thread in Electron JS? I have tried below which works fine in dev mode.

const worker = new Worker(path.join(__dirname, 'worker.js'));

But this causes error when the app is packaged, it is looking for worker.js inside app.asar. Even with the worker.js included in build/files.

0 Answers
Related