refactor: simplify config loading (#918)

pull/931/head
CHOYSEN 2 years ago committed by GitHub
parent bed68f1341
commit 4b9b385aff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -180,14 +180,9 @@ async function resolveUserConfig(
mode: string
): Promise<[UserConfig, string | undefined]> {
// load user config
let configPath
for (const ext of supportedConfigExtensions) {
const p = resolve(root, `config.${ext}`)
if (await fs.pathExists(p)) {
configPath = p
break
}
}
const configPath = supportedConfigExtensions
.map((ext) => resolve(root, `config.${ext}`))
.find(fs.pathExistsSync)
const userConfig: RawConfigExports = configPath
? ((

Loading…
Cancel
Save