Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: ensure that pg-cloudflare can be used with bundlers that don't k…
…now about Cloudflare sockets (#2978) By implementing package.json `exports` we can avoid processing the Cloudflare specific code, which contains `import ... from "cloudflare:sockets"`, in bundlers such as Webpack. If you are bundling for a Worker environment using Webpack then you need to add the `workerd` condition and ignore `cloudflare:sockets` imports: **webpack.config.js** ```js resolve: { conditionNames: ["require", "node", "workerd"] }, plugins: [ new webpack.IgnorePlugin({ resourceRegExp: /^cloudflare:sockets$/, }), ], ```
- Loading branch information