fix: missing name in nuxt object

This commit is contained in:
Julien Huang 2025-01-08 16:27:57 +01:00
parent a848774138
commit 8393d6701d

View File

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