11ty / eleventy-plugin-vite

A plugin to use Vite with Eleventy
140 stars 10 forks source link

Workaround for renaming issue on Windows #34

Closed anantakrishna closed 5 months ago

anantakrishna commented 1 year ago

On Windows, renaming directoryA to directoryB throws an EPERM error if directoryB exists, even if it's empty. More details in https://github.com/nodejs/node/issues/21957#issuecomment-408486653.

This workaround removes the tmp folder before renaming outputDir to it. We cannot eliminate the preceding mkdir because it creates all the parent folders if needed.

Fixes #22, #32.

KiwiKilian commented 5 months ago

I'm closing this PR as similar changes landed through #46. Would be awesome to here, if the problem is fixed. Feel free to reach out in #22 if the problem still persists with the alpha.