Has anyone tried workers with webpack 5/RW0.36.x?

I want to use use a web worker and the docs say that no loader is needed and make it look super simple but I haven’t had any luck. I’m guessing it’s webpack config but I’ve not managed to get anything working.

This question seems most similar to what I’m getting as using new URL(...) has an origin of file:// instead of http. and that leads to a error of Failed to construct 'Worker': Script at 'file:///Users/kurthutten/other/redwoodblog/app/web/src/helpers/cadPackages/jsCad/jscad-worker.worker.js'

But have also been reading through this, and even the minimal example isn’t working.

In the mean time it’s working by putting javascript in the public folder but that not a long term solution.

I bit of follow up, I’m using the webpack 4 worker-loader to load the worker and it seems to be working fine.

Would still like to do it the webpack 5 way in future.