Closed dotnetCarpenter closed 5 years ago
hmm - there's no need for the webpack configuration change. all you have to do is install workerize-loader and add the import prefix, nothing else is required.
@developit I think that is might be related to #32 I've commented the issue: https://github.com/developit/workerize-loader/issues/32#issuecomment-427312716
@developit and @exarus , I got worker-loader working and submitted an example to the nuxt project.
I no longer wish to use workerize-loader, so you can close this issue if you want.
@dotnetCarpenter thanks, I'm looking forward to switch to worker-loader
too, thought workerize-loader
doesn't cause too much trouble at this point of time.
I'm at the end of a nuxt project and want to move some code into a web worker. I've tried to use worker-loader, but failed and was suggested (by @pi0) to give workerize-loader a shot.
Unfortunately, I'm blocked on an nuxt error. Below is the stack trace and after that, the code snippets from the stack trace I've dug up.
code
in thetoCjs
function appears to beundefined
.I've tracked
e.replace
to ([workerize]/dist/workerize.js:39:23):Which is called by ([nuxt]/lib/core/module.js:162:30):
What is in
options
, you ask? - an empty object. Do I need to setup something in my webpack configuration?I've copied the example from this README
assets/js/shared/Loader.worker.js
store/pages.js
my nuxt.config.js, which setup webpack