@@ -294,10 +294,11 @@ export class PlatformService extends EventEmitter implements IPlatformService {
294294 this . $logger . out ( "Preparing project..." ) ;
295295
296296 let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
297- await this . preparePlatformCoreJS ( platform , platformData , appFilesUpdaterOptions , projectData , platformSpecificData , changesInfo ) ;
297+ const projectFilesConfig = helpers . getProjectFilesConfig ( { isReleaseBuild : appFilesUpdaterOptions . release } ) ;
298+ await this . preparePlatformCoreJS ( platform , platformData , appFilesUpdaterOptions , projectData , platformSpecificData , changesInfo , filesToSync , projectFilesConfig ) ;
298299
299300 if ( ! nativePrepare || ! nativePrepare . skipNativePrepare ) {
300- await this . preparePlatformCoreNative ( platform , platformData , appFilesUpdaterOptions , projectData , platformSpecificData , changesInfo ) ;
301+ await this . preparePlatformCoreNative ( platform , platformData , appFilesUpdaterOptions , projectData , platformSpecificData , changesInfo , projectFilesConfig ) ;
301302 }
302303
303304 let directoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
@@ -306,12 +307,12 @@ export class PlatformService extends EventEmitter implements IPlatformService {
306307 excludedDirs . push ( constants . TNS_MODULES_FOLDER_NAME ) ;
307308 }
308309
309- this . $projectFilesManager . processPlatformSpecificFiles ( directoryPath , platform , excludedDirs ) ;
310+ this . $projectFilesManager . processPlatformSpecificFiles ( directoryPath , platform , projectFilesConfig , excludedDirs ) ;
310311
311312 this . $logger . out ( `Project successfully prepared (${ platform } )` ) ;
312313 }
313314
314- private async preparePlatformCoreJS ( platform : string , platformData : IPlatformData , appFilesUpdaterOptions : IAppFilesUpdaterOptions , projectData : IProjectData , platformSpecificData : IPlatformSpecificData , changesInfo ?: IProjectChangesInfo , filesToSync ?: Array < String > , ) : Promise < void > {
315+ private async preparePlatformCoreJS ( platform : string , platformData : IPlatformData , appFilesUpdaterOptions : IAppFilesUpdaterOptions , projectData : IProjectData , platformSpecificData : IPlatformSpecificData , changesInfo ?: IProjectChangesInfo , filesToSync ?: Array < String > , projectFilesConfig ?: IProjectFilesConfig ) : Promise < void > {
315316 if ( ! changesInfo || changesInfo . appFilesChanged ) {
316317 await this . copyAppFiles ( platformData , appFilesUpdaterOptions , projectData ) ;
317318
@@ -324,11 +325,11 @@ export class PlatformService extends EventEmitter implements IPlatformService {
324325 }
325326
326327 if ( ! changesInfo || changesInfo . modulesChanged ) {
327- await this . copyTnsModules ( platform , platformData , projectData ) ;
328+ await this . copyTnsModules ( platform , platformData , projectData , projectFilesConfig ) ;
328329 }
329330 }
330331
331- public async preparePlatformCoreNative ( platform : string , platformData : IPlatformData , appFilesUpdaterOptions : IAppFilesUpdaterOptions , projectData : IProjectData , platformSpecificData : IPlatformSpecificData , changesInfo ?: IProjectChangesInfo ) : Promise < void > {
332+ public async preparePlatformCoreNative ( platform : string , platformData : IPlatformData , appFilesUpdaterOptions : IAppFilesUpdaterOptions , projectData : IProjectData , platformSpecificData : IPlatformSpecificData , changesInfo ?: IProjectChangesInfo , projectFilesConfig ?: IProjectFilesConfig ) : Promise < void > {
332333 if ( changesInfo . hasChanges ) {
333334 await this . cleanProject ( platform , appFilesUpdaterOptions , platformData , projectData ) ;
334335 }
@@ -347,7 +348,7 @@ export class PlatformService extends EventEmitter implements IPlatformService {
347348
348349 let tnsModulesDestinationPath = path . join ( appDestinationDirectoryPath , constants . TNS_MODULES_FOLDER_NAME ) ;
349350 // Process node_modules folder
350- await this . $nodeModulesBuilder . prepareNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData ) ;
351+ await this . $nodeModulesBuilder . prepareNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData , projectFilesConfig ) ;
351352 }
352353
353354 if ( ! changesInfo || changesInfo . configChanged || changesInfo . modulesChanged ) {
@@ -385,14 +386,14 @@ export class PlatformService extends EventEmitter implements IPlatformService {
385386 }
386387 }
387388
388- private async copyTnsModules ( platform : string , platformData : IPlatformData , projectData : IProjectData ) : Promise < void > {
389+ private async copyTnsModules ( platform : string , platformData : IPlatformData , projectData : IProjectData , projectFilesConfig ?: IProjectFilesConfig ) : Promise < void > {
389390 let appDestinationDirectoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
390391 let lastModifiedTime = this . $fs . exists ( appDestinationDirectoryPath ) ? this . $fs . getFsStats ( appDestinationDirectoryPath ) . mtime : null ;
391392
392393 try {
393394 let tnsModulesDestinationPath = path . join ( appDestinationDirectoryPath , constants . TNS_MODULES_FOLDER_NAME ) ;
394395 // Process node_modules folder
395- await this . $nodeModulesBuilder . prepareJSNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData ) ;
396+ await this . $nodeModulesBuilder . prepareJSNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData , projectFilesConfig ) ;
396397 } catch ( error ) {
397398 this . $logger . debug ( error ) ;
398399 shell . rm ( "-rf" , appDestinationDirectoryPath ) ;
0 commit comments