Skip to content

Commit

Permalink
fix(config): try catch unlink after load (#9577)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy committed Aug 8, 2022
1 parent c1fa219 commit d35a1e2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/vite/src/node/config.ts
Expand Up @@ -1039,7 +1039,11 @@ async function loadConfigFromBundledFile(
try {
return (await dynamicImport(fileUrl)).default
} finally {
fs.unlinkSync(fileNameTmp)
try {
fs.unlinkSync(fileNameTmp)
} catch {
// already removed if this function is called twice simultaneously
}
}
}
// for cjs, we can register a custom loader via `_require.extensions`
Expand Down

0 comments on commit d35a1e2

Please sign in to comment.