Skip to content

Commit

Permalink
fix: handle try-catch for fs promise when resolve https config (#12808)
Browse files Browse the repository at this point in the history
  • Loading branch information
windsonR committed Apr 10, 2023
1 parent d037327 commit 0bba402
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions packages/vite/src/node/http.ts
Expand Up @@ -137,11 +137,7 @@ export async function resolveHttpsConfig(

async function readFileIfExists(value?: string | Buffer | any[]) {
if (typeof value === 'string') {
try {
return fsp.readFile(path.resolve(value))
} catch (e) {
return value
}
return fsp.readFile(path.resolve(value)).catch(() => value)
}
return value
}
Expand Down

0 comments on commit 0bba402

Please sign in to comment.