Skip to content

Commit fb79248

Browse files
authored
fix: checking for file existence before unlinking (#169)
1 parent 3f3962e commit fb79248

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/vite.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@ export default function i18n(options: string | VitePluginOptionsInterface = 'lan
1616
let exitHandlersBound: boolean = false
1717

1818
const clean = () => {
19-
files.forEach((file) => unlinkSync(langPath + file.name))
19+
files.forEach((file) => {
20+
const filePath = langPath + file.name
21+
if (existsSync(filePath)) {
22+
unlinkSync(filePath)
23+
}
24+
})
2025

2126
files = []
2227

0 commit comments

Comments
 (0)