@@ -66,7 +66,7 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
66
66
. uniq ( )
67
67
. value ( ) ;
68
68
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 } ) ;
70
70
}
71
71
}
72
72
@@ -78,7 +78,7 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
78
78
const hookArgs = this . getHookArgs ( data , device ) ;
79
79
await this . $hooksService . executeBeforeHooks ( "preview-sync" , { hookArgs } ) ;
80
80
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 } ) ;
82
82
return payloads ;
83
83
}
84
84
@@ -92,7 +92,11 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
92
92
config : {
93
93
env : data . env ,
94
94
platform : device . platform ,
95
- appFilesUpdaterOptions : data . appFilesUpdaterOptions ,
95
+ appFilesUpdaterOptions : {
96
+ bundle : data . bundle ,
97
+ useHotModuleReload : data . useHotModuleReload ,
98
+ release : false
99
+ } ,
96
100
} ,
97
101
externals : this . $previewAppPluginsService . getExternalPlugins ( device ) ,
98
102
filesToSyncMap,
@@ -109,10 +113,10 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
109
113
const platformHmrData = currentHmrData [ platform ] || < any > { } ;
110
114
const filesToSync = _ . cloneDeep ( filesToSyncMap [ platform ] ) ;
111
115
// 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 } ) ;
113
117
await promise ;
114
118
115
- if ( data . appFilesUpdaterOptions . useHotModuleReload && platformHmrData . hash ) {
119
+ if ( data . useHotModuleReload && platformHmrData . hash ) {
116
120
const devices = this . $previewDevicesService . getDevicesForPlatform ( platform ) ;
117
121
118
122
await Promise . all ( _ . map ( devices , async ( previewDevice : Device ) => {
@@ -133,12 +137,12 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
133
137
let payloads = null ;
134
138
135
139
try {
136
- const { appFilesUpdaterOptions , env, projectDir } = data ;
140
+ const { env, projectDir } = data ;
137
141
const projectData = this . $projectDataService . getProjectData ( projectDir ) ;
138
142
const platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
139
143
140
144
if ( ! opts . skipPrepare ) {
141
- await this . preparePlatform ( platform , appFilesUpdaterOptions , env , projectData ) ;
145
+ await this . preparePlatform ( platform , data , env , projectData ) ;
142
146
}
143
147
144
148
if ( opts . isInitialSync ) {
@@ -178,7 +182,12 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
178
182
return { files : payloads , platform : platformData . normalizedPlatformName . toLowerCase ( ) , hmrMode, deviceId } ;
179
183
}
180
184
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
+ } ;
182
191
const nativePrepare = { skipNativePrepare : true } ;
183
192
const config = < IPlatformOptions > { } ;
184
193
const platformTemplate = < string > null ;
0 commit comments