-
-
Notifications
You must be signed in to change notification settings - Fork 7.4k
fix(build): fix ssr environment emitAssets: true when sharedConfigBuild: true
#20787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(build): fix ssr environment emitAssets: true when sharedConfigBuild: true
#20787
Conversation
emitAssets: true when sharedConfigBuild: true
|
/ecosystem-ci run |
commit: |
|
📝 Ran ecosystem CI on
✅ astro, analogjs, ladle, histoire, one, nuxt, marko, quasar, sveltekit, qwik, vite-plugin-cloudflare, vike, rakkas, vite-plugin-pwa, vite-plugin-vue, vite-setup-catalogue, vite-plugin-react, storybook, vitepress, react-router, vuepress, waku, vite-plugin-svelte, vitest, vite-plugin-rsc, vite-environment-examples |
I guess it is because when vite/packages/vite/src/node/build.ts Lines 1621 to 1623 in 91e68a3
|
packages/vite/src/node/config.ts
Outdated
| if (resolved.environments.ssr) { | ||
| resolved.environments.ssr.build.emitAssets = | ||
| resolved.environments.ssr.build.emitAssets ||= |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This backward compat only makes sense with builder.sharedConfigBuild: false because only in that case build.* and environments.ssr.build.* should be synced.
So I think, instead, we can skip this code when sharedConfigBuild is enabled:
if (!sharedConfigBuild && resolved.environments.ssr) {
resolved.environments.ssr.build.emitAssets = resolved.build.ssrEmitAssets || resolved.build.emitAssets
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That sounds simpler. Thanks!
…ts_with_sharedconfigbuild
| datasource | package | from | to | | ---------- | ------- | ----- | ----- | | npm | vite | 7.1.4 | 7.1.7 | ## [v7.1.7](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-717-2025-09-22-small) ##### Bug Fixes - **build:** fix ssr environment `emitAssets: true` when `sharedConfigBuild: true` ([#20787](vitejs/vite#20787)) ([4c4583c](vitejs/vite@4c4583c)) - **client:** use CSP nonce when rendering error overlay ([#20791](vitejs/vite#20791)) ([9bc9d12](vitejs/vite@9bc9d12)) - **deps:** update all non-major dependencies ([#20811](vitejs/vite#20811)) ([9f2247c](vitejs/vite@9f2247c)) - **glob:** handle glob imports from folders starting with dot ([#20800](vitejs/vite#20800)) ([105abe8](vitejs/vite@105abe8)) - **hmr:** trigger prune event when import is removed from non hmr module ([#20768](vitejs/vite#20768)) ([9f32b1d](vitejs/vite@9f32b1d)) - **hmr:** wait for `import.meta.hot.prune` callbacks to complete before running other HMRs ([#20698](vitejs/vite#20698)) ([98a3484](vitejs/vite@98a3484)) ## [v7.1.6](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-716-2025-09-18-small) ##### Bug Fixes - **deps:** update all non-major dependencies ([#20773](vitejs/vite#20773)) ([88af2ae](vitejs/vite@88af2ae)) - **esbuild:** inject esbuild helper functions with minified `$` variables correctly ([#20761](vitejs/vite#20761)) ([7e8e004](vitejs/vite@7e8e004)) - fallback terser to main thread when nameCache is provided ([#20750](vitejs/vite#20750)) ([a679a64](vitejs/vite@a679a64)) - **types:** strict env typings fail when `skipLibCheck` is `false` ([#20755](vitejs/vite#20755)) ([cc54e29](vitejs/vite@cc54e29)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#20675](vitejs/vite#20675)) ([a67bb5f](vitejs/vite@a67bb5f)) - **deps:** update rolldown-related dependencies ([#20772](vitejs/vite#20772)) ([d785e72](vitejs/vite@d785e72)) ## [v7.1.5](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-715-2025-09-08-small) ##### Bug Fixes - apply `fs.strict` check to HTML files ([#20736](vitejs/vite#20736)) ([14015d7](vitejs/vite@14015d7)) - **deps:** update all non-major dependencies ([#20732](vitejs/vite#20732)) ([122bfba](vitejs/vite@122bfba)) - upgrade sirv to 3.0.2 ([#20735](vitejs/vite#20735)) ([09f2b52](vitejs/vite@09f2b52))
| datasource | package | from | to | | ---------- | ------- | ----- | ----- | | npm | vite | 7.1.4 | 7.1.7 | ## [v7.1.7](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-717-2025-09-22-small) ##### Bug Fixes - **build:** fix ssr environment `emitAssets: true` when `sharedConfigBuild: true` ([#20787](vitejs/vite#20787)) ([4c4583c](vitejs/vite@4c4583c)) - **client:** use CSP nonce when rendering error overlay ([#20791](vitejs/vite#20791)) ([9bc9d12](vitejs/vite@9bc9d12)) - **deps:** update all non-major dependencies ([#20811](vitejs/vite#20811)) ([9f2247c](vitejs/vite@9f2247c)) - **glob:** handle glob imports from folders starting with dot ([#20800](vitejs/vite#20800)) ([105abe8](vitejs/vite@105abe8)) - **hmr:** trigger prune event when import is removed from non hmr module ([#20768](vitejs/vite#20768)) ([9f32b1d](vitejs/vite@9f32b1d)) - **hmr:** wait for `import.meta.hot.prune` callbacks to complete before running other HMRs ([#20698](vitejs/vite#20698)) ([98a3484](vitejs/vite@98a3484)) ## [v7.1.6](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-716-2025-09-18-small) ##### Bug Fixes - **deps:** update all non-major dependencies ([#20773](vitejs/vite#20773)) ([88af2ae](vitejs/vite@88af2ae)) - **esbuild:** inject esbuild helper functions with minified `$` variables correctly ([#20761](vitejs/vite#20761)) ([7e8e004](vitejs/vite@7e8e004)) - fallback terser to main thread when nameCache is provided ([#20750](vitejs/vite#20750)) ([a679a64](vitejs/vite@a679a64)) - **types:** strict env typings fail when `skipLibCheck` is `false` ([#20755](vitejs/vite#20755)) ([cc54e29](vitejs/vite@cc54e29)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#20675](vitejs/vite#20675)) ([a67bb5f](vitejs/vite@a67bb5f)) - **deps:** update rolldown-related dependencies ([#20772](vitejs/vite#20772)) ([d785e72](vitejs/vite@d785e72)) ## [v7.1.5](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-715-2025-09-08-small) ##### Bug Fixes - apply `fs.strict` check to HTML files ([#20736](vitejs/vite#20736)) ([14015d7](vitejs/vite@14015d7)) - **deps:** update all non-major dependencies ([#20732](vitejs/vite#20732)) ([122bfba](vitejs/vite@122bfba)) - upgrade sirv to 3.0.2 ([#20735](vitejs/vite#20735)) ([09f2b52](vitejs/vite@09f2b52))
| datasource | package | from | to | | ---------- | ------- | ----- | ----- | | npm | vite | 7.1.4 | 7.1.7 | ## [v7.1.7](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-717-2025-09-22-small) ##### Bug Fixes - **build:** fix ssr environment `emitAssets: true` when `sharedConfigBuild: true` ([#20787](vitejs/vite#20787)) ([4c4583c](vitejs/vite@4c4583c)) - **client:** use CSP nonce when rendering error overlay ([#20791](vitejs/vite#20791)) ([9bc9d12](vitejs/vite@9bc9d12)) - **deps:** update all non-major dependencies ([#20811](vitejs/vite#20811)) ([9f2247c](vitejs/vite@9f2247c)) - **glob:** handle glob imports from folders starting with dot ([#20800](vitejs/vite#20800)) ([105abe8](vitejs/vite@105abe8)) - **hmr:** trigger prune event when import is removed from non hmr module ([#20768](vitejs/vite#20768)) ([9f32b1d](vitejs/vite@9f32b1d)) - **hmr:** wait for `import.meta.hot.prune` callbacks to complete before running other HMRs ([#20698](vitejs/vite#20698)) ([98a3484](vitejs/vite@98a3484)) ## [v7.1.6](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-716-2025-09-18-small) ##### Bug Fixes - **deps:** update all non-major dependencies ([#20773](vitejs/vite#20773)) ([88af2ae](vitejs/vite@88af2ae)) - **esbuild:** inject esbuild helper functions with minified `$` variables correctly ([#20761](vitejs/vite#20761)) ([7e8e004](vitejs/vite@7e8e004)) - fallback terser to main thread when nameCache is provided ([#20750](vitejs/vite#20750)) ([a679a64](vitejs/vite@a679a64)) - **types:** strict env typings fail when `skipLibCheck` is `false` ([#20755](vitejs/vite#20755)) ([cc54e29](vitejs/vite@cc54e29)) ##### Miscellaneous Chores - **deps:** update rolldown-related dependencies ([#20675](vitejs/vite#20675)) ([a67bb5f](vitejs/vite@a67bb5f)) - **deps:** update rolldown-related dependencies ([#20772](vitejs/vite#20772)) ([d785e72](vitejs/vite@d785e72)) ## [v7.1.5](https://github.com/vitejs/vite/blob/HEAD/packages/vite/CHANGELOG.md#small-715-2025-09-08-small) ##### Bug Fixes - apply `fs.strict` check to HTML files ([#20736](vitejs/vite#20736)) ([14015d7](vitejs/vite@14015d7)) - **deps:** update all non-major dependencies ([#20732](vitejs/vite#20732)) ([122bfba](vitejs/vite@122bfba)) - upgrade sirv to 3.0.2 ([#20735](vitejs/vite#20735)) ([09f2b52](vitejs/vite@09f2b52))
Description
environments.ssr.build.emitAssets: truenot working whenbuilder.sharedConfigBuild: true#20774I'm not entirely sure why this only occurs with
sharedConfigBuild, but for the back compat purpose explained in the comment, I think it's safe to taking||of all options.