File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 33 addServerHandler ,
44 createResolver ,
55 defineNuxtModule ,
6- resolveModule ,
6+ tryResolveModule ,
77 addImportsDir ,
88 addTemplate
99} from '@nuxt/kit'
@@ -111,13 +111,16 @@ export default defineNuxtModule<ModuleOptions>({
111111 let components : Component [ ] = [ ]
112112 let metaSources : NuxtComponentMeta = { }
113113
114+ const uiTemplatesPath = await tryResolveModule ( '@nuxt/ui-templates' )
114115 nuxt . hook ( 'components:dirs' , ( dirs ) => {
115116 componentDirs = [
116117 ...componentDirs ,
117118 ...dirs ,
118- { path : resolveModule ( 'nuxt' ) . replace ( '/index.mjs' , '/app' ) } ,
119- { path : resolveModule ( '@nuxt/ui-templates' ) . replace ( '/index.mjs' , '/templates' ) }
119+ { path : nuxt . options . appDir }
120120 ]
121+ if ( uiTemplatesPath ) {
122+ componentDirs . push ( { path : uiTemplatesPath . replace ( '/index.mjs' , '/templates' ) } )
123+ }
121124 parserOptions . componentDirs = componentDirs
122125 } )
123126
You can’t perform that action at this time.
0 commit comments