Closed freezy closed 5 years ago
This allows bundling the web worker in third-party clients by passing a worker instance to the initialize function of the WPC API.
A Webpack setup would look like this:
npm install worker-loader --save-dev
import Worker from 'worker-loader!wpc-emu/lib/webclient/webworker.js'; const wpcEmuWebWorkerApi = WpcEmuWebWorkerApi.initialiseWebworkerAPI(new Worker()); // wpc api available!
Note that you don't need a separate entry point for the worker when building with Webpack anymore.
This patch is backwards-compatible.
thanks! that resolves one of my quirks!
This allows bundling the web worker in third-party clients by passing a worker instance to the initialize function of the WPC API.
A Webpack setup would look like this:
npm install worker-loader --save-dev
Note that you don't need a separate entry point for the worker when building with Webpack anymore.
This patch is backwards-compatible.