Describe the bug
@vitejs/plugin-rsc uses building same environment instance twice, such as following:
import { defineConfig } from 'vite';
export default defineConfig({
builder: {
async buildApp(builder) {
builder.environments.client.config.build.write = false;
await builder.build(builder.environments.client);
builder.environments.client.config.build.write = true;
await builder.build(builder.environments.client);
},
},
});
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.
This behavior change was found in vitejs/vite-plugin-react#1198
Reproduction
https://stackblitz.com/edit/vitejs-vite-2gdu7zbt?file=vite.config.ts
Steps to reproduce
- open stackblitz
- run
vite build
- see there's no
dist/favicon.svg
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 22.22.0 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
vite: ^8.0.10 => 8.0.10
Used Package Manager
npm
Logs
No response
Validations
Describe the bug
@vitejs/plugin-rscuses building same environment instance twice, such as following: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.
This behavior change was found in vitejs/vite-plugin-react#1198
Reproduction
https://stackblitz.com/edit/vitejs-vite-2gdu7zbt?file=vite.config.ts
Steps to reproduce
vite builddist/favicon.svgSystem Info
System: OS: Linux 5.0 undefined CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz Memory: 0 Bytes / 0 Bytes Shell: 1.0 - /bin/jsh Binaries: Node: 22.22.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 10.8.2 - /usr/local/bin/npm pnpm: 8.15.6 - /usr/local/bin/pnpm npmPackages: vite: ^8.0.10 => 8.0.10Used Package Manager
npm
Logs
No response
Validations