Embedding worker in Electron app using Webpack and electron-builder
Disclaimer: as per electron-boilerplate
Make webpack bundle your worker code. I’ll skip the entire code here because it’s too long.
Remeber the output path
1 | { |
Make electron-builder copy your worker bundle file .
1 | { |
This will place your worker bunlde file inside resources/app.asar
.
Adjust worker path and working directory for fork
in main.dev.ts
.
1 | const workerPath = |