fix(nuxi): replace lazyHandle to defineLazyHandler (#8049)

This commit is contained in:
Cupid Valentine 2022-10-10 00:17:38 +08:00 committed by GitHub
parent 6d904663a4
commit c905a23b1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -35,6 +35,7 @@
"execa": "^6.1.0",
"flat": "^5.0.2",
"giget": "^0.1.7",
"h3": "^0.7.21",
"jiti": "^1.16.0",
"listhen": "^0.3.4",
"mlly": "^0.5.16",

View File

@ -1,6 +1,6 @@
import { promises as fsp } from 'node:fs'
import { join, resolve } from 'pathe'
import { createApp, lazyHandle } from 'h3'
import { createApp, defineLazyHandler } from 'h3'
import { listen } from 'listhen'
import { writeTypes } from '../utils/prepare'
import { loadKit } from '../utils/kit'
@ -37,7 +37,7 @@ export default defineNuxtCommand({
const app = createApp()
const serveFile = (filePath: string) => lazyHandle(async () => {
const serveFile = (filePath: string) => defineLazyHandler(async () => {
const contents = await fsp.readFile(filePath, 'utf-8')
return (_req, res) => { res.end(contents) }
})

View File

@ -10470,6 +10470,7 @@ __metadata:
flat: ^5.0.2
fsevents: ~2.3.2
giget: ^0.1.7
h3: ^0.7.21
jiti: ^1.16.0
listhen: ^0.3.4
mlly: ^0.5.16