Produce an ESM build/change usage of require('buffer')? #117
danawoodman
started this conversation in
Ideas
Replies: 1 comment
-
Hey @danawoodman, current examples point to Webpack because they actually offer a way to build which involves Webpack. Otherwise, I set up an example with Webpack 5 as an external tool. So, this does not actually preclude the possibility to use a different bundler. I never used I think the issue here is that Cloudflare Workers do not actually have support for Buffers, hence it should be polyfilled. I don't know how this is possible with Let me know if by doing this you are able to solve. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm attempting to generate an ESM build that I'm going to use in a CloudFlare Worker.
The current examples point to using Webpack, which I would very much like to avoid for a variety of reasons, especially dev/build speed.
I've had success using tsup for bundling for workers in other projects, but using passkit-generator fails with:
If I change to a cjs export then I get the following errors:
I've tried many workarounds but they're all failing at the usage of Buffer in this project and I'm not sure where to go from here.
Is there plans to generate an ESM build and/or change how buffer is required in the project to not require the usage of import rewriting like is required when using Webpack?
Beta Was this translation helpful? Give feedback.
All reactions