File tree Expand file tree Collapse file tree
packages/project/lib/build/cache Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -680,19 +680,18 @@ export default class ProjectBuildCache {
680680 async #updateSourceIndex( changedResourcePaths ) {
681681 const sourceReader = this . #project. getSourceReader ( ) ;
682682
683- const resources = await Promise . all ( changedResourcePaths . map ( ( resourcePath ) => {
684- return sourceReader . byPath ( resourcePath ) ;
685- } ) ) ;
686- const removedResources = [ ] ;
687- const foundResources = resources . filter ( ( resource ) => {
688- if ( ! resource ) {
689- removedResources . push ( resource ) ;
690- return false ;
683+ const resources = [ ] ;
684+ const removedResourcePaths = [ ] ;
685+ await Promise . all ( changedResourcePaths . map ( async ( resourcePath ) => {
686+ const resource = await sourceReader . byPath ( resourcePath ) ;
687+ if ( resource ) {
688+ resources . push ( resource ) ;
689+ } else {
690+ removedResourcePaths . push ( resourcePath ) ;
691691 }
692- return true ;
693- } ) ;
694- const { removed} = await this . #sourceIndex. removeResources ( removedResources ) ;
695- const { added, updated} = await this . #sourceIndex. upsertResources ( foundResources , Date . now ( ) ) ;
692+ } ) ) ;
693+ const { removed} = await this . #sourceIndex. removeResources ( removedResourcePaths ) ;
694+ const { added, updated} = await this . #sourceIndex. upsertResources ( resources , Date . now ( ) ) ;
696695
697696 if ( removed . length || added . length || updated . length ) {
698697 log . verbose ( `Source resource index for project ${ this . #project. getName ( ) } updated: ` +
Original file line number Diff line number Diff line change @@ -336,7 +336,11 @@ class ResourceRequestManager {
336336 let changedPaths ;
337337 if ( diff ) {
338338 const { added, updated, removed} = diff ;
339- changedPaths = Array . from ( new Set ( [ ...added , ...updated , ...removed ] ) ) ;
339+ if ( removed . length ) {
340+ // Cannot use differential build if a resource has been removed
341+ continue ;
342+ }
343+ changedPaths = Array . from ( new Set ( [ ...added , ...updated ] ) ) ;
340344 } else {
341345 changedPaths = [ ] ;
342346 }
You can’t perform that action at this time.
0 commit comments