@@ -56,6 +56,15 @@ export default defineNuxtModule<ModuleOptions>({
5656 if ( typeof moduleOptions . client === 'undefined' )
5757 moduleOptions . client = ! ! nuxt . options . dev
5858
59+ const nuxtSchemaComposablesRuntime = `${ moduleRuntimeDir } /composables`
60+
61+ const providerPath = await resolvePath ( `${ schemaOrgPath } /providers/${ moduleOptions . full ? 'full' : 'simple' } ` )
62+ // might need this again
63+ nuxt . options . alias [ Pkg ] = schemaOrgPath
64+ // set the alias for the types
65+ nuxt . options . alias [ '#vueuse/schema-org/provider' ] = providerPath
66+ nuxt . options . alias [ '#vueuse/schema-org/runtime' ] = nuxtSchemaComposablesRuntime
67+
5968 // fallback clears schema on route change
6069 if ( ! moduleOptions . client )
6170 addPlugin ( resolve ( moduleRuntimeDir , 'plugin-fallback.client' ) )
@@ -65,8 +74,6 @@ export default defineNuxtModule<ModuleOptions>({
6574 mode : moduleOptions . client ? 'all' : 'server' ,
6675 } )
6776
68- const nuxtSchemaComposablesRuntime = `${ moduleRuntimeDir } /composables`
69-
7077 addTemplate ( {
7178 filename : 'nuxt-schema-org-config.mjs' ,
7279 getContents : ( ) => `export default ${ JSON . stringify ( moduleOptions ) } ` ,
@@ -111,6 +118,7 @@ export default defineNuxtModule<ModuleOptions>({
111118 mock : ! moduleOptions . client && isClient ,
112119 full : moduleOptions . full ,
113120 aliasPaths : {
121+ provider : providerPath ,
114122 pkgDir : schemaOrgPath ,
115123 runtime : nuxtSchemaComposablesRuntime ,
116124 } ,
0 commit comments