diff --git a/packages/pg-cloudflare/package.json b/packages/pg-cloudflare/package.json index 848de0f98..73a3a976f 100644 --- a/packages/pg-cloudflare/package.json +++ b/packages/pg-cloudflare/package.json @@ -2,13 +2,17 @@ "name": "pg-cloudflare", "version": "1.1.0", "description": "A socket implementation that can run on Cloudflare Workers using native TCP connections.", - "main": "dist/index.js", + "main": "dist/empty.js", "types": "dist/index.d.ts", "license": "MIT", "devDependencies": { "ts-node": "^8.5.4", "typescript": "^4.0.3" }, + "exports": { + "workerd": "./dist/index.js", + "default": "./dist/empty.js" + }, "scripts": { "build": "tsc", "build:watch": "tsc --watch", diff --git a/packages/pg-cloudflare/src/empty.ts b/packages/pg-cloudflare/src/empty.ts new file mode 100644 index 000000000..f1e6740db --- /dev/null +++ b/packages/pg-cloudflare/src/empty.ts @@ -0,0 +1,3 @@ +// This is an empty module that is served up when outside of a workerd environment +// See the `exports` field in package.json +export default {}