Use capacitor plugin in web worker

I’m offloading heavy calculations to a web worker. The web worker is all set up and integrated into my app.
But it can’t access capacitor plugins.

Importing any capacitor plugin causes the error message:
ReferenceError: window is not defined

Is there a way around this?

Some capacitor plugins probably really need access to window, or the dom. For example for storage.
But I’m actually only interested in calling custom native code.