@sanity/client 3.3.3-esm.12 → 3.3.3-esm.16
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.
- package/index.module.js +9 -0
- package/package.json +4 -3
package/index.module.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// If fetch is defined we assume it's either a browser or a worker env (Bun, Deno or Edge) and we divert to the browser version
|
|
2
|
+
// Although Node is shipping `fetch` support soon this check
|
|
3
|
+
// won't affect it as Node respects conditional package exports and this file ain't listed.
|
|
4
|
+
// The EdgeRuntime check is to support dead-code elimination on Vercel Edge Functions:
|
|
5
|
+
// https://edge-runtime.vercel.sh/features/available-apis#addressing-the-runtime
|
|
6
|
+
module.exports =
|
|
7
|
+
typeof fetch === 'function' || typeof EdgeRuntime === 'string'
|
|
8
|
+
? require('./dist/sanityClient.browser.mjs')
|
|
9
|
+
: require('./lib/sanityClient.js')
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sanity/client",
|
|
3
|
-
"version": "3.3.3-esm.
|
|
3
|
+
"version": "3.3.3-esm.16",
|
|
4
4
|
"description": "Client for retrieving, creating and patching data from Sanity.io",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "lib/sanityClient.js",
|
|
7
|
-
"module": "./
|
|
7
|
+
"module": "./index.module.js",
|
|
8
8
|
"umd": "umd/sanityClient.min.js",
|
|
9
9
|
"unpkg": "umd/sanityClient.min.js",
|
|
10
10
|
"types": "./sanityClient.d.ts",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"dist",
|
|
23
23
|
"lib",
|
|
24
24
|
"umd",
|
|
25
|
+
"index.module.js",
|
|
25
26
|
"sanityClient.d.ts"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
51
52
|
"@sanity/eventsource": "^4.0.0",
|
|
52
|
-
"get-it": "6.1.1-esm.
|
|
53
|
+
"get-it": "6.1.1-esm.13",
|
|
53
54
|
"make-error": "^1.3.0",
|
|
54
55
|
"rxjs": "^6.6.7"
|
|
55
56
|
},
|