how to load webworker file
-
I want to load the webworker file in the boot file.
Here is what I did:export default function MyWorker(store){ const worker = new Worker('/assets/worker/worker.js'); console.log('in worker', worker) Vue.prototype.$worker = worker }
The file is 404 not found.
I tried with'../assets/worker/worker.js' '/statics/worker/worker.js' '../statics/worker/worker.js'
All not working.
I even tried with load the file from index.js, still not working.
Anyone know how to do it properly? -
@tc said in how to load webworker file:
const worker = new Worker(’/assets/worker/worker.js’);
did you try this:
const worker = new Worker('statics/worker/worker.js');
-
@dobbel Yes. I did. Still not working.
I end up using
workerize-loader
.