Building tips (vite/esbuild)

Hi there, I don't use wrangler to deploy but rather I bundle using esbuild and then deploy my script via terraform. I've had to implement a few workarounds, mainly node compat, to get my bundle working. For example, replace any global Buffer references with an import, and stubbing the "os" module with some fake data to get opentelemetry working I'm now trying to bundle jose which claims cloudflare support, but having some issues - namely they're importing buffer without the node: prefix, and they're importing crypto instead of using the global API. How can I get my build to create a bundle that just works on cloudflare?
1 Reply
matt // unweb
matt // unwebOP15mo ago
ah I think I need to add "browser" to the conditions
Want results from more Discord servers?
Add your server