fix: specify a config file error

This commit is contained in:
alex8088 2022-09-19 18:32:39 +08:00
parent da50aa9246
commit 556fe95f20

View file

@ -209,7 +209,7 @@ export async function loadConfigFromFile(
let resolvedPath: string let resolvedPath: string
let isESM = false let isESM = false
if (configFile && /^vite.config.(js)|(ts)|(mjs)|(cjs)$/.test(configFile)) { if (configFile && /^vite.config.(js|ts|mjs|cjs)$/.test(configFile)) {
throw new Error(`config file cannot be named ${configFile}.`) throw new Error(`config file cannot be named ${configFile}.`)
} }