@@ -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,14 +224,20 @@ 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 ) ;
239
+ }
240
+ if ( changesInfo . hasChanges ) {
234
241
this . $projectChangesService . savePrepareInfo ( platform , projectData ) ;
235
242
} else {
236
243
this . $logger . out ( "Skipping prepare." ) ;
@@ -302,6 +309,16 @@ export class PlatformService extends EventEmitter implements IPlatformService {
302
309
303
310
if ( ! changesInfo || changesInfo . modulesChanged ) {
304
311
await this . copyTnsModules ( platform , projectData ) ;
312
+ } else if ( appFilesUpdaterOptions . bundle ) {
313
+ let dependencies = this . $nodeModulesDependenciesBuilder . getProductionDependencies ( projectData . projectDir ) ;
314
+ for ( let dependencyKey in dependencies ) {
315
+ const dependency = dependencies [ dependencyKey ] ;
316
+ let isPlugin = ! ! dependency . nativescript ;
317
+ if ( isPlugin ) {
318
+ let pluginData = this . $pluginsService . convertToPluginData ( dependency , projectData . projectDir ) ;
319
+ await this . $pluginsService . preparePluginNativeCode ( pluginData , platform , projectData ) ;
320
+ }
321
+ }
305
322
}
306
323
307
324
let directoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
0 commit comments