npm install -g @vue/cli
vue create threadtest
vue add electron-builder
yarn add threads threads-plugin
NOTE This demo requires manually modifying the threads package in the same way, in two places, after installing node_modules with yarn
.
- /dist-esm/master/implementation.js
- /dist-esm/worker/implementation.js
// const runningInNode = typeof process !== 'undefined' && process.arch !== 'browser' && 'pid' in process;
const runningInNode = false
child_process
should be a Node module with methods like spawn
and fork
.
child_process
is an empty object
More info: andywer/threads.js#199 andywer/threads-plugin#13
yarn electron:serve