You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: guide/api-environment-frameworks.md
+7-5Lines changed: 7 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -84,7 +84,7 @@ Note that although the `FetchableDevEnvironment` is implemented as a class, it i
84
84
85
85
## Default `RunnableDevEnvironment`
86
86
87
-
Given a Vite server configured in middleware mode as described by the [SSR setup guide](/guide/ssr#setting-up-the-dev-server), let's implement the SSR middleware using the environment API. Error handling is omitted.
87
+
Given a Vite server configured in middleware mode as described by the [SSR setup guide](/guide/ssr#setting-up-the-dev-server), let's implement the SSR middleware using the environment API. Remember that it doesn't have to be called `ssr`, so we'll name it `server` in this example. Error handling is omitted.
88
88
89
89
```js
90
90
importfsfrom'node:fs'
@@ -94,7 +94,7 @@ import { createServer } from 'vite'
Copy file name to clipboardExpand all lines: guide/api-environment.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ For a simple SPA/MPA, no new APIs around environments are exposed to the config.
22
22
When we move to a typical server-side rendered (SSR) app, we'll have two environments:
23
23
24
24
-`client`: runs the app in the browser.
25
-
-`server`: runs the app in node (or other server runtimes) which renders pages before sending them to the browser.
25
+
-`ssr`: runs the app in node (or other server runtimes) which renders pages before sending them to the browser.
26
26
27
27
In dev, Vite executes the server code in the same Node process as the Vite dev server, giving a close approximation to the production environment. However, it is also possible for servers to run in other JS runtimes, like [Cloudflare's workerd](https://github.com/cloudflare/workerd) which have different constraints. Modern apps may also run in more than two environments, e.g. a browser, a node server, and an edge server. Vite 5 didn't allow to properly represent these environments.
0 commit comments