@sanity/client 6.27.2-resources.0 → 6.27.2-resources.1
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/dist/_chunks-cjs/config.cjs +9 -1
- package/dist/_chunks-cjs/config.cjs.map +1 -1
- package/dist/_chunks-es/config.js +9 -1
- package/dist/_chunks-es/config.js.map +1 -1
- package/dist/index.browser.cjs +9 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +9 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
- package/src/config.ts +10 -0
- package/umd/sanityClient.js +9 -1
- package/umd/sanityClient.min.js +2 -2
package/dist/index.browser.js
CHANGED
|
@@ -230,7 +230,15 @@ const initConfig = (config, prevConfig) => {
|
|
|
230
230
|
const newConfig = {
|
|
231
231
|
...defaultConfig,
|
|
232
232
|
...specifiedConfig
|
|
233
|
-
}
|
|
233
|
+
};
|
|
234
|
+
if (newConfig.projectId?.startsWith("resource.")) {
|
|
235
|
+
const [, resourceType, resourceId] = newConfig.projectId?.split(".");
|
|
236
|
+
resourceType && resourceId && (newConfig.experimental_resource = {
|
|
237
|
+
type: resourceType,
|
|
238
|
+
id: resourceId
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
const experimentalResource = newConfig.experimental_resource;
|
|
234
242
|
experimentalResource && (newConfig.useProjectHostname = !1);
|
|
235
243
|
const projectBased = newConfig.useProjectHostname;
|
|
236
244
|
if (typeof Promise > "u") {
|