File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ <template >
2+ <Icon name="uil:0-plus " />
3+ </template >
Original file line number Diff line number Diff line change 1+ export default defineNuxtConfig ( { } )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import Module from '../../src/module'
33export default defineNuxtConfig ( {
44 extends : [
55 './base' ,
6+ '../dummy' ,
67 ] ,
78
89 modules : [
Original file line number Diff line number Diff line change @@ -173,7 +173,10 @@ export class NuxtIconModuleContext {
173173 ] ,
174174 }
175175 this . scanner = new IconUsageScanner ( scanOptions )
176- await this . scanner . scanFiles ( this . nuxt . options . rootDir , this . scannedIcons )
176+ await this . scanner . scanFiles (
177+ this . nuxt . options . _layers . map ( layer => layer . cwd ) ,
178+ this . scannedIcons ,
179+ )
177180 }
178181
179182 const icons = new Set < string > ( [ ...userIcons , ...this . scannedIcons ] )
Original file line number Diff line number Diff line change @@ -46,21 +46,26 @@ export class IconUsageScanner {
4646 }
4747
4848 async scanFiles (
49- cwd : string ,
49+ cwd : string | string [ ] ,
5050 set : Set < string > = new Set ( ) ,
5151 ) {
52- const files = await glob (
53- this . globInclude ,
54- {
55- ignore : this . globExclude ,
56- cwd,
57- absolute : true ,
58- expandDirectories : false ,
59- } ,
52+ const dirs = Array . isArray ( cwd ) ? cwd : [ cwd ]
53+ const files = new Set (
54+ ( await Promise . all (
55+ dirs . map ( dir => glob (
56+ this . globInclude ,
57+ {
58+ ignore : this . globExclude ,
59+ cwd : dir ,
60+ absolute : true ,
61+ expandDirectories : false ,
62+ } ,
63+ ) ) ,
64+ ) ) . flat ( ) ,
6065 )
6166
6267 await Promise . all (
63- files . map ( async ( file ) => {
68+ [ ... files ] . map ( async ( file ) => {
6469 const code = await fs . readFile ( file , 'utf-8' ) . catch ( ( ) => '' )
6570 this . extractFromCode ( code , set )
6671 } ) ,
You can’t perform that action at this time.
0 commit comments