@@ -3,7 +3,7 @@ import crypto from 'node:crypto'
3
3
import { existsSync } from 'node:fs'
4
4
import { createJiti } from 'jiti'
5
5
import { createRegExp , exactly } from 'magic-regexp'
6
- import { addComponentsDir , addImports , addPlugin , addServerHandler , addTemplate , defineNuxtModule , resolvePath , useLogger , isNuxtMajorVersion } from '@nuxt/kit'
6
+ import { addComponentsDir , addImports , addPlugin , addServerHandler , addTemplate , defineNuxtModule , resolvePath , useLogger } from '@nuxt/kit'
7
7
8
8
import { colors } from 'consola/utils'
9
9
import { join , relative , resolve } from 'pathe'
@@ -115,7 +115,6 @@ export default defineNuxtModule<SanityModuleOptions>({
115
115
configKey : CONFIG_KEY ,
116
116
compatibility : {
117
117
nuxt : '>=3.7.0' ,
118
- bridge : true ,
119
118
} ,
120
119
} ,
121
120
defaults : {
@@ -237,11 +236,6 @@ export default defineNuxtModule<SanityModuleOptions>({
237
236
238
237
if ( options . globalHelper ) {
239
238
addPlugin ( { src : join ( runtimeDir , 'plugins/global-helper' ) } )
240
- if ( isNuxtMajorVersion ( 2 ) ) {
241
- nuxt . hook ( 'prepare:types' , ( { references } ) => {
242
- references . push ( { types : '@nuxtjs/sanity/dist/runtime/plugins/global-helper' } )
243
- } )
244
- }
245
239
}
246
240
247
241
const composablesFile = visualEditing ? join ( runtimeDir , 'composables/visual-editing' ) : join ( runtimeDir , 'composables/index' )
@@ -251,7 +245,7 @@ export default defineNuxtModule<SanityModuleOptions>({
251
245
{ name : 'groq' , from : join ( runtimeDir , 'groq' ) } ,
252
246
{ name : 'useSanity' , from : composablesFile } ,
253
247
{ name : 'useLazySanityQuery' , from : join ( runtimeDir , 'composables/index' ) } ,
254
- ... isNuxtMajorVersion ( 3 ) ? [ { name : 'useSanityQuery' , from : composablesFile } ] : [ ] ,
248
+ { name : 'useSanityQuery' , from : composablesFile } ,
255
249
] )
256
250
257
251
const clientPath = await resolvePath ( clientSpecifier )
@@ -324,14 +318,12 @@ export default defineNuxtModule<SanityModuleOptions>({
324
318
] ,
325
319
} )
326
320
// Add auto-imports for visual editing
327
- if ( isNuxtMajorVersion ( 3 ) ) {
328
- addImports ( [
329
- { name : 'useSanityLiveMode' , from : composablesFile } ,
330
- { name : 'useSanityVisualEditing' , from : composablesFile } ,
331
- { name : 'useSanityVisualEditingState' , from : composablesFile } ,
332
- { name : 'createDataAttribute' , from : '@sanity/visual-editing' , as : 'createSanityDataAttribute' } ,
333
- ] )
334
- }
321
+ addImports ( [
322
+ { name : 'useSanityLiveMode' , from : composablesFile } ,
323
+ { name : 'useSanityVisualEditing' , from : composablesFile } ,
324
+ { name : 'useSanityVisualEditingState' , from : composablesFile } ,
325
+ { name : 'createDataAttribute' , from : '@sanity/visual-editing' , as : 'createSanityDataAttribute' } ,
326
+ ] )
335
327
336
328
// Plugin to check visual editing on app initialisation
337
329
addPlugin ( {
0 commit comments