Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

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

Merged
merged 1 commit into from
Sep 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/nuxi/src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
Expand Down