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 {
369369
370370 detectProjectConfigs ( projectDir ?: string ) : IProjectConfigInformation ;
371371
372- getDefaultTSConfig ( appId : string ) : string ;
372+ getDefaultTSConfig ( appId : string , appPath : string ) : string ;
373373
374374 writeDefaultConfig ( projectDir ?: string , appId ?: string ) : boolean | string ;
375375
Original file line number Diff line number Diff line change @@ -64,11 +64,15 @@ export class ProjectConfigService implements IProjectConfigService {
6464 return this . $injector . resolve ( "projectHelper" ) ;
6565 }
6666
67- public getDefaultTSConfig ( appId : string = "org.nativescript.app" ) {
67+ public getDefaultTSConfig (
68+ appId : string = "org.nativescript.app" ,
69+ appPath : string = "app"
70+ ) {
6871 return `import { NativeScriptConfig } from '@nativescript/core';
6972
7073export default {
7174 id: '${ appId } ',
75+ appPath: '${ appPath } ',
7276 appResourcesPath: 'App_Resources',
7377 android: {
7478 v8Flags: '--expose_gc',
@@ -274,7 +278,19 @@ export default {
274278 return false ;
275279 }
276280
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 ) ) ;
278294
279295 return TSConfigPath ;
280296 }
Original file line number Diff line number Diff line change @@ -622,11 +622,12 @@ export class ProjectConfigServiceStub implements IProjectConfigService {
622622 } ;
623623 }
624624
625- getDefaultTSConfig ( appId : string ) : string {
625+ getDefaultTSConfig ( appId : string , appPath : string ) : string {
626626 return `import { NativeScriptConfig } from '@nativescript/core';
627627
628628 export default {
629629 id: '${ appId } ',
630+ appPath: '${ appPath } '
630631 appResourcesPath: 'App_Resources',
631632 android: {
632633 v8Flags: '--expose_gc',
You can’t perform that action at this time.
0 commit comments