Skip to content

Commit

Permalink
docs: __dirname is not available in ES modules (#9151)
Browse files Browse the repository at this point in the history
  • Loading branch information
lili21 committed Jul 17, 2022
1 parent 344642a commit cc980b0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion docs/guide/ssr.md
Expand Up @@ -64,8 +64,11 @@ When building an SSR app, you likely want to have full control over your main se
```js{17-19}
import fs from 'fs'
import path from 'path'
import { fileURLToPath } from 'url'
import express from 'express'
import {createServer as createViteServer} from 'vite'
import { createServer as createViteServer } from 'vite'

const __dirname = path.dirname(fileURLToPath(import.meta.url))

async function createServer() {
const app = express()
Expand Down

0 comments on commit cc980b0

Please sign in to comment.