Skip to content

Commit

Permalink
docs: createNodeDevEnvironment requires hot option (#18027)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Sep 4, 2024
1 parent cb24d3c commit a7bf7af
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions docs/guide/api-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,9 @@ The default SSR Node module runner is not exposed. You can use `createNodeEnviro
```js
import {
createServer,
createServerHotChannel,
createServerModuleRunner,
createNodeEnvironment,
createNodeDevEnvironment,
} from 'vite'

const server = await createServer({
Expand All @@ -154,7 +155,11 @@ const server = await createServer({
dev: {
// Default Vite SSR environment can be overridden in the config, so
// make sure you have a Node environment before the request is received.
createEnvironment: createNodeEnvironment,
createEnvironment(name, config) {
return createNodeDevEnvironment(name, config, {
hot: createServerHotChannel(),
})
},
},
},
},
Expand Down

0 comments on commit a7bf7af

Please sign in to comment.