@@ -11,9 +11,8 @@ import {
1111 addTemplate ,
1212 defineNuxtModule ,
1313 resolvePath ,
14- isNuxt2 ,
15- isNuxt3 ,
1614 useLogger ,
15+ isNuxtMajorVersion ,
1716} from '@nuxt/kit'
1817
1918import chalk from 'chalk'
@@ -247,7 +246,7 @@ export default defineNuxtModule<SanityModuleOptions>({
247246
248247 if ( options . globalHelper ) {
249248 addPlugin ( { src : join ( runtimeDir , 'plugins/global-helper' ) } )
250- if ( isNuxt2 ( ) ) {
249+ if ( isNuxtMajorVersion ( 2 ) ) {
251250 nuxt . hook ( 'prepare:types' , ( { references } ) => {
252251 references . push ( { types : '@nuxtjs/sanity/dist/runtime/plugins/global-helper' } )
253252 } )
@@ -261,7 +260,7 @@ export default defineNuxtModule<SanityModuleOptions>({
261260 { name : 'groq' , from : join ( runtimeDir , 'groq' ) } ,
262261 { name : 'useSanity' , from : composablesFile } ,
263262 { name : 'useLazySanityQuery' , from : join ( runtimeDir , 'composables/index' ) } ,
264- ...isNuxt3 ( ) ? [ { name : 'useSanityQuery' , from : composablesFile } ] : [ ] ,
263+ ...isNuxtMajorVersion ( 3 ) ? [ { name : 'useSanityQuery' , from : composablesFile } ] : [ ] ,
265264 ] )
266265
267266 const clientPath = await resolvePath ( clientSpecifier )
@@ -332,7 +331,7 @@ export default defineNuxtModule<SanityModuleOptions>({
332331 ] ,
333332 } )
334333 // Add auto-imports for visual editing
335- if ( isNuxt3 ( ) ) {
334+ if ( isNuxtMajorVersion ( 3 ) ) {
336335 addImports ( [
337336 { name : 'useSanityLiveMode' , from : composablesFile } ,
338337 { name : 'useSanityVisualEditing' , from : composablesFile } ,
0 commit comments