@sanity/client 3.3.3-esm.13 → 3.3.3-esm.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/edge-or-node.js +8 -0
  2. package/package.json +2 -1
@@ -0,0 +1,8 @@
1
+ // Vercel's Edge Runtime works fine when using a bundler like Next.js, but if it's a vanilla
2
+ // function it's not adhering to pkg.exports, but it does adhere to pkg.module
3
+ // Based on https://github.com/vercel/edge-runtime/blob/1bd7684d479696843013520b0ce86c728566ec2a/packages/ponyfill/src/index.js#L1-L2
4
+
5
+ module.exports =
6
+ typeof EdgeRuntime === 'string'
7
+ ? require('./dist/sanityClient.browser.mjs')
8
+ : require('./lib/sanityClient.js')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanity/client",
3
- "version": "3.3.3-esm.13",
3
+ "version": "3.3.3-esm.14",
4
4
  "description": "Client for retrieving, creating and patching data from Sanity.io",
5
5
  "type": "commonjs",
6
6
  "main": "lib/sanityClient.js",
@@ -22,6 +22,7 @@
22
22
  "dist",
23
23
  "lib",
24
24
  "umd",
25
+ "edge-or-node.js",
25
26
  "sanityClient.d.ts"
26
27
  ],
27
28
  "scripts": {