@@ -139,6 +139,7 @@ export class ProjectDirManager {
139139 private trackingComponents = Object . create ( null ) as Record < string , ComponentJsonData >
140140 private convertedExpr = Object . create ( null ) as Record < string , ConvertedExprCache >
141141 private pendingAsyncTasks = 0
142+ private firstScanDone = false
142143 wxmlEnvGetter : ( tsFullPath : string , wxmlFullPath : string ) => string | null = ( ) => null
143144 onEntranceFileAdded : ( fullPath : string ) => void = ( ) => { }
144145 onEntranceFileRemoved : ( fullPath : string ) => void = ( ) => { }
@@ -156,7 +157,10 @@ export class ProjectDirManager {
156157 this . tsc = tsc
157158 this . tmplGroup = tmplGroup
158159 this . rootPath = rootPath
159- this . vfs = new VirtualFileSystem ( rootPath , firstScanCallback )
160+ this . vfs = new VirtualFileSystem ( rootPath , ( ) => {
161+ this . firstScanDone = true
162+ firstScanCallback ( )
163+ } )
160164 this . vfs . onFileFound = ( fullPath ) => {
161165 this . handleFileOpened ( fullPath )
162166 }
@@ -191,7 +195,7 @@ export class ProjectDirManager {
191195 this . asyncWxmlConvertedExprUpdate ( `${ compPath } .wxml` )
192196 this . onEntranceFileAdded ( `${ compPath } .wxml` )
193197 }
194- } else if ( isTsFile ( fullPath ) ) {
198+ } else if ( isTsFile ( fullPath ) && this . firstScanDone ) {
195199 this . checkConvertedExprCache ( `${ compPath } .wxml` )
196200 this . forEachDirectDependantComponents ( compPath , ( compPath ) => {
197201 this . checkConvertedExprCache ( `${ compPath } .wxml` )
0 commit comments