Bundling of remote dependencies
I'm trying to import a function from a package that is browser first. That is
exports: { browser: "..." }
in package.json.
As a reproductible example, I'm trying to import from remote
Error given:
Is there any parameter to enable bundling these dependency or do I have to roll my own Custom Build (https://developers.cloudflare.com/workers/wrangler/custom-builds/) ?
If I do, is there an example repo that does this? I know my way around esbuild and don't mind copy&past a plugin that I wrote that can bundle remote dependencies.4 Replies
Please keep in mind that
jose
is only used to reproduce the issue and I understand that jose
is supported. I'm just using it as a simple reproductible example.You can't import from a remote Url in workers. This is by design, as CF wants all code executed on workers so it can track down bugs / vulnerabilities. There might be a way to add it as part of a build step, but I'm afraid I can't help with that 😅
Can’t you just run Deno bundle?
Indeed. I guess I'll need to figure out how custom build works.