File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,16 @@ export default defineNuxtModule<ModuleOptions>({
118118 ]
119119 parserOptions . componentDirs = componentDirs
120120 } )
121+
122+ // Add global components path to handle components added with `addComponent` utility
123+ nuxt . hook ( 'components:extend' , ( _components ) => {
124+ _components . forEach ( ( c ) => {
125+ if ( c . global ) {
126+ parserOptions . componentDirs . push ( c . filePath )
127+ }
128+ } )
129+ } )
130+
121131 nuxt . hook ( 'components:extend' , async ( _components ) => {
122132 components = _components
123133
Original file line number Diff line number Diff line change @@ -91,7 +91,13 @@ export function useComponentMetaParser (
9191 skipLibCheck : true ,
9292 include : [
9393 '**/*' ,
94- ...componentDirs . map ( dir => `${ typeof dir === 'string' ? dir : ( dir ?. path || '' ) } /**/*` )
94+ ...componentDirs . map ( ( dir ) => {
95+ const path = typeof dir === 'string' ? dir : ( dir ?. path || '' )
96+ if ( path . endsWith ( '.vue' ) ) {
97+ return path
98+ }
99+ return `${ path } /**/*`
100+ } )
95101 ] ,
96102 exclude : [ ]
97103 } ,
You can’t perform that action at this time.
0 commit comments