fix(nuxi): stub defineNuxtConfig for nuxi info (#7728)

This commit is contained in:
Daniel Roe 2022-09-22 14:51:13 +01:00 committed by GitHub
parent 230af9c186
commit 084188e7de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,7 +119,10 @@ function normalizeConfigModule (module: NuxtModule | string | null | undefined,
function getNuxtConfig (rootDir: string) {
try {
return jiti(rootDir, { interopDefault: true, esmResolve: true })('./nuxt.config')
(globalThis as any).defineNuxtConfig = (c: any) => c
const result = jiti(rootDir, { interopDefault: true, esmResolve: true })('./nuxt.config')
delete (globalThis as any).defineNuxtConfig
return result
} catch (err) {
// TODO: Show error as warning if it is not 404
return {}