You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
public directory is not copied when building twice with write: false and then write: true #22305
Since Vite 8.0.9, this doesn't copy public directory on second build.
This specific behavior only hits unconventional rsc examples, so this isn't critical, but just reporting it here if anyone has an idea where this is expected, whether this should be avoided, etc.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Activity
sapphi-red commentedon Apr 23, 2026
Ah, this is probably because the copy sets a flag once the
renderStartis called regardless of whether the copy actually happened.vite/packages/vite/src/node/plugins/prepareOutDir.ts
Lines 20 to 23 in a190035
Probably we can move
rendered.add(this.environment)inside theif (config.build.write).