refactor: make code clean

pull/918/head
CHOYSEN 3 years ago
parent 3e0c5e406d
commit e249cd4784

@ -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