Skip to content

Commit de40592

Browse files
committed
fix: ssrBuild is optional, avoid breaking VitePress
1 parent 188f188 commit de40592

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

docs/config/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export default defineConfig(({ command, mode, ssrBuild }) => {
8080

8181
It is important to note that in Vite's API the `command` value is `serve` during dev (in the cli `vite`, `vite dev`, and `vite serve` are aliases), and `build` when building for production (`vite build`).
8282

83-
Only `ssrBuild` is included instead of a more general `ssr` flag because, during dev, the config is shared by the single server handling SSR and non-SSR requests.
83+
`ssrBuild` is experimental. It is only available during build instead of a more general `ssr` flag because, during dev, the config is shared by the single server handling SSR and non-SSR requests. The value could be `undefined` for tools that don't have separate commands for the browser and SSR build, so use explicit comparison against `true` and `false`.
8484

8585
## Async Config
8686

packages/vite/src/node/config.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,10 @@ export type { RenderBuiltAssetUrl } from './build'
6666
export interface ConfigEnv {
6767
command: 'build' | 'serve'
6868
mode: string
69-
ssrBuild: boolean
69+
/**
70+
* @experimental
71+
*/
72+
ssrBuild?: boolean
7073
}
7174

7275
/**

0 commit comments

Comments
 (0)