@@ -39,7 +39,8 @@ export class PlatformService extends EventEmitter implements IPlatformService {
39
39
private $npm : INodePackageManager ,
40
40
private $devicePlatformsConstants : Mobile . IDevicePlatformsConstants ,
41
41
private $projectChangesService : IProjectChangesService ,
42
- private $analyticsService : IAnalyticsService ) {
42
+ private $analyticsService : IAnalyticsService ,
43
+ private $nodeModulesDependenciesBuilder : INodeModulesDependenciesBuilder ) {
43
44
super ( ) ;
44
45
}
45
46
@@ -223,13 +224,17 @@ export class PlatformService extends EventEmitter implements IPlatformService {
223
224
let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
224
225
await this . $pluginsService . validate ( platformData , projectData ) ;
225
226
227
+ const bundle = appFilesUpdaterOptions . bundle ;
228
+
226
229
await this . ensurePlatformInstalled ( platform , platformTemplate , projectData , config ) ;
227
- let changesInfo = this . $projectChangesService . checkForChanges ( platform , projectData , { bundle : appFilesUpdaterOptions . bundle , release : appFilesUpdaterOptions . release , provision : config . provision } ) ;
230
+ let changesInfo = this . $projectChangesService . checkForChanges ( platform , projectData , { bundle, release : appFilesUpdaterOptions . release , provision : config . provision } ) ;
228
231
229
232
this . $logger . trace ( "Changes info in prepare platform:" , changesInfo ) ;
230
233
231
234
if ( changesInfo . hasChanges ) {
232
235
await this . cleanProject ( platform , appFilesUpdaterOptions , platformData , projectData ) ;
236
+ }
237
+ if ( changesInfo . hasChanges || bundle ) {
233
238
await this . preparePlatformCore ( platform , appFilesUpdaterOptions , projectData , config , changesInfo , filesToSync ) ;
234
239
this . $projectChangesService . savePrepareInfo ( platform , projectData ) ;
235
240
} else {
@@ -302,6 +307,16 @@ export class PlatformService extends EventEmitter implements IPlatformService {
302
307
303
308
if ( ! changesInfo || changesInfo . modulesChanged ) {
304
309
await this . copyTnsModules ( platform , projectData ) ;
310
+ } else if ( appFilesUpdaterOptions . bundle ) {
311
+ let dependencies = this . $nodeModulesDependenciesBuilder . getProductionDependencies ( projectData . projectDir ) ;
312
+ for ( let dependencyKey in dependencies ) {
313
+ const dependency = dependencies [ dependencyKey ] ;
314
+ let isPlugin = ! ! dependency . nativescript ;
315
+ if ( isPlugin ) {
316
+ let pluginData = this . $pluginsService . convertToPluginData ( dependency , projectData . projectDir ) ;
317
+ await this . $pluginsService . preparePluginNativeCode ( pluginData , platform , projectData ) ;
318
+ }
319
+ }
305
320
}
306
321
307
322
let directoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
0 commit comments