@@ -66,7 +66,7 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
6666 . uniq ( )
6767 . value ( ) ;
6868 for ( const platform of platforms ) {
69- await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
69+ await this . syncFilesForPlatformSafe ( data , platform , { filesToSync, filesToRemove, useHotModuleReload : data . useHotModuleReload } ) ;
7070 }
7171 }
7272
@@ -78,7 +78,7 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
7878 const hookArgs = this . getHookArgs ( data , device ) ;
7979 await this . $hooksService . executeBeforeHooks ( "preview-sync" , { hookArgs } ) ;
8080 await this . $previewAppPluginsService . comparePluginsOnDevice ( data , device ) ;
81- const payloads = await this . syncFilesForPlatformSafe ( data , device . platform , { isInitialSync : true , useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
81+ const payloads = await this . syncFilesForPlatformSafe ( data , device . platform , { isInitialSync : true , useHotModuleReload : data . useHotModuleReload } ) ;
8282 return payloads ;
8383 }
8484
@@ -92,7 +92,11 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
9292 config : {
9393 env : data . env ,
9494 platform : device . platform ,
95- appFilesUpdaterOptions : data . appFilesUpdaterOptions ,
95+ appFilesUpdaterOptions : {
96+ bundle : data . bundle ,
97+ useHotModuleReload : data . useHotModuleReload ,
98+ release : false
99+ } ,
96100 } ,
97101 externals : this . $previewAppPluginsService . getExternalPlugins ( device ) ,
98102 filesToSyncMap,
@@ -109,10 +113,10 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
109113 const platformHmrData = currentHmrData [ platform ] || < any > { } ;
110114 const filesToSync = _ . cloneDeep ( filesToSyncMap [ platform ] ) ;
111115 // We don't need to prepare when webpack emits changed files. We just need to send a message to pubnub.
112- promise = this . syncFilesForPlatformSafe ( data , platform , { filesToSync, skipPrepare : true , useHotModuleReload : data . appFilesUpdaterOptions . useHotModuleReload } ) ;
116+ promise = this . syncFilesForPlatformSafe ( data , platform , { filesToSync, skipPrepare : true , useHotModuleReload : data . useHotModuleReload } ) ;
113117 await promise ;
114118
115- if ( data . appFilesUpdaterOptions . useHotModuleReload && platformHmrData . hash ) {
119+ if ( data . useHotModuleReload && platformHmrData . hash ) {
116120 const devices = this . $previewDevicesService . getDevicesForPlatform ( platform ) ;
117121
118122 await Promise . all ( _ . map ( devices , async ( previewDevice : Device ) => {
@@ -133,12 +137,12 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
133137 let payloads = null ;
134138
135139 try {
136- const { appFilesUpdaterOptions , env, projectDir } = data ;
140+ const { env, projectDir } = data ;
137141 const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
138142 const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
139143
140144 if ( ! opts . skipPrepare ) {
141- await this . preparePlatform ( platform , appFilesUpdaterOptions , env , projectData ) ;
145+ await this . preparePlatform ( platform , data , env , projectData ) ;
142146 }
143147
144148 if ( opts . isInitialSync ) {
@@ -178,7 +182,12 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
178182 return { files : payloads , platform : platformData . normalizedPlatformName . toLowerCase ( ) , hmrMode, deviceId } ;
179183 }
180184
181- private async preparePlatform ( platform : string , appFilesUpdaterOptions : IAppFilesUpdaterOptions , env : Object , projectData : IProjectData ) : Promise < void > {
185+ private async preparePlatform ( platform : string , data : IPreviewAppLiveSyncData , env : Object , projectData : IProjectData ) : Promise < void > {
186+ const appFilesUpdaterOptions = {
187+ bundle : data . bundle ,
188+ useHotModuleReload : data . useHotModuleReload ,
189+ release : false
190+ } ;
182191 const nativePrepare = { skipNativePrepare : true } ;
183192 const config = < IPlatformOptions > { } ;
184193 const platformTemplate = < string > null ;
0 commit comments