diff options
author | 2022-04-19 03:08:44 -0700 | |
---|---|---|
committer | 2022-04-19 10:08:44 +0000 | |
commit | 385046aaa72ae0d664dc57c806bbb240459209f2 (patch) | |
tree | b8f8285fe1d122c81be408dd4644be289bc36d22 | |
parent | 0682832a54c2db6770ac611f509a59ff9ef61521 (diff) | |
download | astro-385046aaa72ae0d664dc57c806bbb240459209f2.tar.gz astro-385046aaa72ae0d664dc57c806bbb240459209f2.tar.zst astro-385046aaa72ae0d664dc57c806bbb240459209f2.zip |
improve legacy config warning message (#3142)
-rw-r--r-- | packages/astro/src/core/config.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts index dd33919d8..57b45ef1b 100644 --- a/packages/astro/src/core/config.ts +++ b/packages/astro/src/core/config.ts @@ -233,16 +233,16 @@ export async function validateConfig( process.exit(1); } - let oldConfig = false; + let legacyConfigKey: string | undefined; for (const key of Object.keys(userConfig)) { if (LEGACY_ASTRO_CONFIG_KEYS.has(key)) { - oldConfig = true; + legacyConfigKey = key; break; } } - if (oldConfig) { + if (legacyConfigKey) { throw new Error( - `Legacy configuration detected. Please update your configuration to the new format!\nSee https://astro.build/config for more information.` + `Legacy configuration detected: "${legacyConfigKey}".\nPlease update your configuration to the new format!\nSee https://astro.build/config for more information.` ); } /* eslint-enable no-console */ |