Nuxt/examples/web-worker/plugins/inject-ww.js
2018-03-18 01:45:52 +01:00

10 lines
250 B
JavaScript

import ExampleWorker from '~/assets/js/Example.worker.js' // worker files has to end in ".worker.js" - see nuxt.config.js
export default (context, inject) => {
inject('worker', {
createWorker () {
return new ExampleWorker()
}
})
}