@@ -194,6 +194,10 @@ export class PlatformService extends EventEmitter implements IPlatformService {
194194 const requiresNativePrepare = ( ! platformInfo . nativePrepare || ! platformInfo . nativePrepare . skipNativePrepare ) && changesInfo . nativePlatformStatus === constants . NativePlatformStatus . requiresPrepare ;
195195
196196 if ( changesInfo . hasChanges || platformInfo . appFilesUpdaterOptions . bundle || requiresNativePrepare ) {
197+ if ( changesInfo . bundleChanged ) {
198+ await this . cleanDestinationApp ( platformInfo ) ;
199+ }
200+
197201 await this . preparePlatformCore (
198202 platformInfo . platform ,
199203 platformInfo . appFilesUpdaterOptions ,
@@ -553,13 +557,13 @@ export class PlatformService extends EventEmitter implements IPlatformService {
553557 return null ;
554558 }
555559
556- public async cleanDestinationApp ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , platformTemplate : string , projectData : IProjectData , config : IPlatformOptions ) : Promise < void > {
557- await this . ensurePlatformInstalled ( platform , platformTemplate , projectData , config ) ;
560+ public async cleanDestinationApp ( platformInfo : IPreparePlatformInfo ) : Promise < void > {
561+ await this . ensurePlatformInstalled ( platformInfo . platform , platformInfo . platformTemplate , platformInfo . projectData , platformInfo . config ) ;
558562
559- const appSourceDirectoryPath = path . join ( projectData . projectDir , constants . APP_FOLDER_NAME ) ;
560- const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
563+ const appSourceDirectoryPath = path . join ( platformInfo . projectData . projectDir , constants . APP_FOLDER_NAME ) ;
564+ const platformData = this . $platformsData . getPlatformData ( platformInfo . platform , platformInfo . projectData ) ;
561565 const appDestinationDirectoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
562- const appUpdater = new AppFilesUpdater ( appSourceDirectoryPath , appDestinationDirectoryPath , appFilesUpdaterOptions , this . $fs ) ;
566+ const appUpdater = new AppFilesUpdater ( appSourceDirectoryPath , appDestinationDirectoryPath , platformInfo . appFilesUpdaterOptions , this . $fs ) ;
563567 appUpdater . cleanDestinationApp ( ) ;
564568 }
565569
0 commit comments