Skip to content

Commit 72c0e5c

Browse files
committed
docs
Signed-off-by: Marc MacLeod <[email protected]>
1 parent 3fc8cc1 commit 72c0e5c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

docs/config/ssr-options.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,19 @@ Prevent listed dependencies from being externalized for SSR. If `true`, no depen
2020
- **Default:** `node`
2121

2222
Build target for the SSR server.
23+
24+
## ssr.resolve.conditions
25+
26+
- **Type:** `string[]`
27+
- **Related:** [Resolve Conditions](./shared-options.md#resolve-conditions)
28+
29+
Defaults to the the root [`resolve.conditions`](./shared-options.md#resolve-conditions).
30+
31+
These conditions are used in the plugin pipeline, and only affect non-externalized dependencies during the SSR build. Use `ssr.resolve.externalConditions` to affect externalized imports.
32+
33+
## ssr.resolve.externalConditions
34+
35+
- **Type:** `string[]`
36+
- **Default:** `[]`
37+
38+
Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.

docs/guide/ssr.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,10 @@ In some cases like `webworker` runtimes, you might want to bundle your SSR build
259259
- Treat all dependencies as `noExternal`
260260
- Throw an error if any Node.js built-ins are imported
261261
262+
## SSR Resolve conditions
263+
264+
By default package entry resolution will use the conditions set in [Resolve Conditions](../config/shared-options.md#resolve-conditions) for the SSR build. You can use [`ssr.resolve.conditions`](../config/ssr-options.md#ssr-resolve-conditions) and [`ssr.resolve.externalConditions`](../config/ssr-options.md#ssr-resolve-externalconditions) to customize this behavior.
265+
262266
## Vite CLI
263267
264268
The CLI commands `$ vite dev` and `$ vite preview` can also be used for SSR apps. You can add your SSR middlewares to the development server with [`configureServer`](/guide/api-plugin#configureserver) and to the preview server with [`configurePreviewServer`](/guide/api-plugin#configurepreviewserver).

0 commit comments

Comments
 (0)