@@ -91,7 +91,10 @@ export default {
9191 ) ;
9292 }
9393
94- public detectProjectConfigs ( projectDir ?: string ) : IProjectConfigInformation {
94+ public detectProjectConfigs (
95+ projectDir ?: string ,
96+ options ?: { suppressWarnings ?: boolean } ,
97+ ) : IProjectConfigInformation {
9598 // allow overriding config name with env variable or --config (or -c)
9699 let configName : string | boolean =
97100 process . env . NATIVESCRIPT_CONFIG_NAME ?? this . $options . config ;
@@ -154,9 +157,11 @@ export default {
154157 const hasNSConfig = ! ! NSConfigPath && hasExistingConfig ;
155158 const usingNSConfig = ! ( hasTSConfig || hasJSConfig ) ;
156159
157- if ( hasTSConfig && hasJSConfig ) {
160+ if ( hasTSConfig && hasJSConfig && ! options ?. suppressWarnings ) {
158161 this . $logger . warn (
159- `You have both a ${ CONFIG_FILE_NAME_JS } and ${ CONFIG_FILE_NAME_TS } file. Defaulting to ${ CONFIG_FILE_NAME_TS } .` ,
162+ `You have both a ${ CONFIG_FILE_NAME_JS } and ${ CONFIG_FILE_NAME_TS } file in ${ path . dirname (
163+ TSConfigPath ,
164+ ) } . Defaulting to ${ CONFIG_FILE_NAME_TS } .`,
160165 ) ;
161166 }
162167
@@ -172,8 +177,11 @@ export default {
172177 }
173178
174179 @exported ( "projectConfigService" )
175- public readConfig ( projectDir ?: string ) : INsConfig {
176- const info = this . detectProjectConfigs ( projectDir ) ;
180+ public readConfig (
181+ projectDir ?: string ,
182+ options ?: { suppressWarnings ?: boolean } ,
183+ ) : INsConfig {
184+ const info = this . detectProjectConfigs ( projectDir , options ) ;
177185
178186 if (
179187 this . forceUsingLegacyConfig ||
0 commit comments