Skip to content
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
6 changes: 3 additions & 3 deletions src/commands/info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default defineCommand({
const cwd = resolve(ctx.args.cwd || ctx.args.rootDir || '.')

// Load Nuxt config
const nuxtConfig = getNuxtConfig(cwd)
const nuxtConfig = await getNuxtConfig(cwd)

// Find nearest package.json
const { dependencies = {}, devDependencies = {} } = findPackage(cwd)
Expand Down Expand Up @@ -162,7 +162,7 @@ function normalizeConfigModule(
return null
}

function getNuxtConfig(rootDir: string) {
async function getNuxtConfig(rootDir: string) {
try {
const jiti = createJiti(rootDir, {
interopDefault: true,
Expand All @@ -173,7 +173,7 @@ function getNuxtConfig(rootDir: string) {
},
})
;(globalThis as any).defineNuxtConfig = (c: any) => c
const result = jiti.import('./nuxt.config') as NuxtConfig
const result = await jiti.import('./nuxt.config') as NuxtConfig
delete (globalThis as any).defineNuxtConfig
return result
}
Expand Down