improve legacy config warning message (#3142)
This commit is contained in:
parent
0682832a54
commit
385046aaa7
1 changed files with 4 additions and 4 deletions
|
@ -233,16 +233,16 @@ export async function validateConfig(
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
let oldConfig = false;
|
let legacyConfigKey: string | undefined;
|
||||||
for (const key of Object.keys(userConfig)) {
|
for (const key of Object.keys(userConfig)) {
|
||||||
if (LEGACY_ASTRO_CONFIG_KEYS.has(key)) {
|
if (LEGACY_ASTRO_CONFIG_KEYS.has(key)) {
|
||||||
oldConfig = true;
|
legacyConfigKey = key;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oldConfig) {
|
if (legacyConfigKey) {
|
||||||
throw new Error(
|
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 */
|
/* eslint-enable no-console */
|
||||||
|
|
Loading…
Reference in a new issue