fix: missing name in nuxt object

This commit is contained in:
Julien Huang 2025-01-08 16:27:57 +01:00
parent d7946f92ac
commit e872a19dae

View File

@ -51,7 +51,7 @@ import { randomUUID } from 'node:crypto'
export function createNuxt (options: NuxtOptions): Nuxt {
const hooks = createHooks<NuxtHooks>()
const name = randomUUID()
const name = randomUUID() // TODO find project name in package json instead
const nuxt: Nuxt = {
_version: version,
options,
@ -63,6 +63,7 @@ export function createNuxt (options: NuxtOptions): Nuxt {
close: () => hooks.callHook('close', nuxt),
vfs: {},
apps: {},
name
}
hooks.hookOnce('close', () => { hooks.removeAllHooks() })