Skip to content

Commit

Permalink
improve legacy config warning message (withastro#3142)
Browse files Browse the repository at this point in the history
  • Loading branch information
FredKSchott committed Apr 19, 2022
1 parent 0682832 commit 385046a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions packages/astro/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 385046a

Please sign in to comment.