Nuxt/examples/web-worker/plugins/inject-ww.js

10 lines
250 B
JavaScript
Raw Normal View History

2018-03-18 00:45:52 +00:00
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()
}
})
}