File tree Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Expand file tree Collapse file tree 3 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -369,7 +369,7 @@ interface IProjectConfigService {
369
369
370
370
detectProjectConfigs ( projectDir ?: string ) : IProjectConfigInformation ;
371
371
372
- getDefaultTSConfig ( appId : string ) : string ;
372
+ getDefaultTSConfig ( appId : string , appPath : string ) : string ;
373
373
374
374
writeDefaultConfig ( projectDir ?: string , appId ?: string ) : boolean | string ;
375
375
Original file line number Diff line number Diff line change @@ -64,11 +64,15 @@ export class ProjectConfigService implements IProjectConfigService {
64
64
return this . $injector . resolve ( "projectHelper" ) ;
65
65
}
66
66
67
- public getDefaultTSConfig ( appId : string = "org.nativescript.app" ) {
67
+ public getDefaultTSConfig (
68
+ appId : string = "org.nativescript.app" ,
69
+ appPath : string = "app"
70
+ ) {
68
71
return `import { NativeScriptConfig } from '@nativescript/core';
69
72
70
73
export default {
71
74
id: '${ appId } ',
75
+ appPath: '${ appPath } ',
72
76
appResourcesPath: 'App_Resources',
73
77
android: {
74
78
v8Flags: '--expose_gc',
@@ -274,7 +278,19 @@ export default {
274
278
return false ;
275
279
}
276
280
277
- this . $fs . writeFile ( TSConfigPath , this . getDefaultTSConfig ( appId ) ) ;
281
+ const possibleAppPaths = [
282
+ path . resolve ( projectDir , constants . SRC_DIR ) ,
283
+ path . resolve ( projectDir , constants . APP_FOLDER_NAME ) ,
284
+ ] ;
285
+
286
+ let appPath = possibleAppPaths . find ( ( possiblePath ) =>
287
+ this . $fs . exists ( possiblePath )
288
+ ) ;
289
+ if ( appPath ) {
290
+ appPath = path . relative ( projectDir , appPath ) . replace ( path . sep , "/" ) ;
291
+ }
292
+
293
+ this . $fs . writeFile ( TSConfigPath , this . getDefaultTSConfig ( appId , appPath ) ) ;
278
294
279
295
return TSConfigPath ;
280
296
}
Original file line number Diff line number Diff line change @@ -622,11 +622,12 @@ export class ProjectConfigServiceStub implements IProjectConfigService {
622
622
} ;
623
623
}
624
624
625
- getDefaultTSConfig ( appId : string ) : string {
625
+ getDefaultTSConfig ( appId : string , appPath : string ) : string {
626
626
return `import { NativeScriptConfig } from '@nativescript/core';
627
627
628
628
export default {
629
629
id: '${ appId } ',
630
+ appPath: '${ appPath } '
630
631
appResourcesPath: 'App_Resources',
631
632
android: {
632
633
v8Flags: '--expose_gc',
You can’t perform that action at this time.
0 commit comments