1 parent 1f542a0 commit 68faefaCopy full SHA for 68faefa
2 files changed
src/module.ts
@@ -139,10 +139,6 @@ export default defineNuxtModule<SanityModuleOptions>({
139
...getDefaultSanityConfig(resolve(nuxt.options.rootDir, './sanity.json')),
140
}),
141
async setup (options, nuxt) {
142
- if (!('useCdn' in options)) {
143
- options.useCdn = process.env.NODE_ENV === 'production' && !options.token
144
- }
145
-
146
if (options.visualEditing) {
147
try {
148
if (options.minimal) {
src/runtime/composables/index.ts
@@ -42,6 +42,8 @@ export const useSanity = (client = 'default'): SanityHelper => {
42
43
if (!options.disableSmartCdn && nuxtApp.$preview) {
44
options.useCdn = false
45
+ } else if (!import.meta.dev && !options.useCdn && !options.token) {
46
+ options.useCdn = true
47
}
48
49
if (client === 'default') {
0 commit comments