@@ -6,6 +6,7 @@ import * as semver from "semver";
6
6
import { EventEmitter } from "events" ;
7
7
import { AppFilesUpdater } from "./app-files-updater" ;
8
8
import { attachAwaitDetach } from "../common/helpers" ;
9
+ import { Configurations } from "../common/constants" ;
9
10
import * as temp from "temp" ;
10
11
temp . track ( ) ;
11
12
let clui = require ( "clui" ) ;
@@ -306,7 +307,10 @@ export class PlatformService extends EventEmitter implements IPlatformService {
306
307
}
307
308
308
309
if ( ! changesInfo || changesInfo . modulesChanged ) {
309
- await this . copyTnsModules ( platform , projectData ) ;
310
+ const projectFilesConfig : IProjectFilesConfig = {
311
+ configuration : appFilesUpdaterOptions . release ? Configurations . Release . toLowerCase ( ) : Configurations . Debug . toLowerCase ( )
312
+ } ;
313
+ await this . copyTnsModules ( platform , projectData , projectFilesConfig ) ;
310
314
} else if ( appFilesUpdaterOptions . bundle ) {
311
315
let dependencies = this . $nodeModulesDependenciesBuilder . getProductionDependencies ( projectData . projectDir ) ;
312
316
for ( let dependencyKey in dependencies ) {
@@ -325,7 +329,11 @@ export class PlatformService extends EventEmitter implements IPlatformService {
325
329
excludedDirs . push ( constants . TNS_MODULES_FOLDER_NAME ) ;
326
330
}
327
331
328
- this . $projectFilesManager . processPlatformSpecificFiles ( directoryPath , platform , excludedDirs ) ;
332
+ const projectFilesConfig : IProjectFilesConfig = {
333
+ configuration : appFilesUpdaterOptions . release ? Configurations . Release . toLowerCase ( ) : Configurations . Debug . toLowerCase ( )
334
+ } ;
335
+
336
+ this . $projectFilesManager . processPlatformSpecificFiles ( directoryPath , platform , projectFilesConfig , excludedDirs ) ;
329
337
330
338
if ( ! changesInfo || changesInfo . configChanged || changesInfo . modulesChanged ) {
331
339
await platformData . platformProjectService . processConfigurationFilesFromAppResources ( appFilesUpdaterOptions . release , projectData ) ;
@@ -364,15 +372,15 @@ export class PlatformService extends EventEmitter implements IPlatformService {
364
372
}
365
373
}
366
374
367
- private async copyTnsModules ( platform : string , projectData : IProjectData ) : Promise < void > {
375
+ private async copyTnsModules ( platform : string , projectData : IProjectData , projectFilesConfig : IProjectFilesConfig ) : Promise < void > {
368
376
let platformData = this . $platformsData . getPlatformData ( platform , projectData ) ;
369
377
let appDestinationDirectoryPath = path . join ( platformData . appDestinationDirectoryPath , constants . APP_FOLDER_NAME ) ;
370
378
let lastModifiedTime = this . $fs . exists ( appDestinationDirectoryPath ) ? this . $fs . getFsStats ( appDestinationDirectoryPath ) . mtime : null ;
371
379
372
380
try {
373
381
let tnsModulesDestinationPath = path . join ( appDestinationDirectoryPath , constants . TNS_MODULES_FOLDER_NAME ) ;
374
382
// Process node_modules folder
375
- await this . $nodeModulesBuilder . prepareNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData ) ;
383
+ await this . $nodeModulesBuilder . prepareNodeModules ( tnsModulesDestinationPath , platform , lastModifiedTime , projectData , projectFilesConfig ) ;
376
384
} catch ( error ) {
377
385
this . $logger . debug ( error ) ;
378
386
shell . rm ( "-rf" , appDestinationDirectoryPath ) ;
0 commit comments