Unable to build googleapis within a worker

Hi, I have been trying to make use of the googleapis library in a worker, but have been unable to build my worker with this dependency added. The problem seems to be that googleapis has a bunch of dependencies that are built into node that are not available when the build target is the worker platform. This of course makes sense. I’ve been experimenting with tools like unenv as a way to mock/polyfill those depedencies, but the integration seems to deep.

Has anyone successfully used googleapis in a worker?

I was able to use @esbuild-plugins/node-modules-polyfill to get rid of most of the build errors that I saw for the built-in node dependencies. Then, however, I ran into this:

[mf:err] TypeError: globalThis.XMLHttpRequest is not a constructor

I can’t seem to find a way to fix this last problem, though. My understanding is this global might be set in the browser, so now the problem may be that the platform is now the browser.