Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed Jul 12, 2024
1 parent 259cb37 commit 9d2efd0
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/guide/api-vite-environment.md
Original file line number Diff line number Diff line change
Expand Up @@ -809,7 +809,7 @@ await createServer({
```ts
import { ESModulesEvaluator, ModuleRunner } from 'vite/module-runner'

const runner = new ModuleRunner(
export const runner = new ModuleRunner(
{
root: fileURLToPath(new URL('./', import.meta.url)),
transport: {
Expand Down Expand Up @@ -841,6 +841,8 @@ processRoutes(routes)
This makes it impossible to run user code in the same way it might run in production (for example, on the edge) because the server state and user state are coupled. So instead, we recommend using virtual modules to import the state and process it inside the user module:
```ts
// this code runs on another machine or in another thread

import { runner } from './ssr-module-runner.js'
import { processRoutes } from './routes-processor.js'

Expand Down

0 comments on commit 9d2efd0

Please sign in to comment.