Beacuase we cannot use Three.js inside a Web Worker, we need a specific bundle/build. Let's look at the Web Worker again.
example/web-worker/worker/worker.js
importScripts('path to new bundle');onmessage= (e) => {constifcData=e.data;constloaded=IFCjs.loadIfcFileItems(ifcData);conststructured=IFCjs.constructProject(loaded);postMessage(structured);};
We are only using two functions. The simpliest approach is to only bundle these two functions... so, let's do that!
Let's create a new src file. We can call this IFC.worker.js.