mirror of
https://github.com/vitejs/vite.git
synced 2024-11-22 07:09:05 +00:00
docs: __dirname is not available in ES modules (#9151)
This commit is contained in:
parent
344642ad63
commit
cc980b0944
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user