Skip to content

Commit f39896e

Browse files
sapphi-redbluwy
andauthored
docs: expand description of externalConditions (#18619)
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
1 parent 866a433 commit f39896e

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

Diff for: docs/config/ssr-options.md

+9-1
Original file line numberDiff line numberDiff line change
@@ -44,4 +44,12 @@ These conditions are used in the plugin pipeline, and only affect non-externaliz
4444
- **Type:** `string[]`
4545
- **Default:** `['node']`
4646

47-
Conditions that are used during ssr import (including `ssrLoadModule`) of externalized dependencies.
47+
Conditions that are used during ssr import (including `ssrLoadModule`) of externalized direct dependencies (external dependencies imported by Vite).
48+
49+
:::tip
50+
51+
When using this option, make sure to run Node with [`--conditions` flag](https://nodejs.org/docs/latest/api/cli.html#-c-condition---conditionscondition) with the same values in both dev and build to get a consistent behavior.
52+
53+
For example, when setting `['node', 'custom']`, you should run `NODE_OPTIONS='--conditions custom' vite` in dev and `NODE_OPTIONS="--conditions custom" node ./dist/server.js` after build.
54+
55+
:::

0 commit comments

Comments
 (0)