Skip to content

Commit 2f6bca8

Browse files
committedAug 22, 2024
fix: preset not being resolved when using --target
Fixes #345
1 parent 82f687c commit 2f6bca8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

Diff for: ‎src/util/kit.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { NuxtModule, NuxtPage } from 'nuxt/schema'
22
import type { Nuxt } from '@nuxt/schema'
3-
import { addTemplate, createResolver, extendPages, loadNuxtModuleInstance, useNuxt } from '@nuxt/kit'
3+
import { addTemplate, createResolver, extendPages, loadNuxtModuleInstance, useNuxt, tryUseNuxt } from '@nuxt/kit'
44
import { relative } from 'pathe'
55
import type { Nitro } from 'nitropack'
66
import { env, provider } from 'std-env'
@@ -104,6 +104,7 @@ export function detectTarget(options: { static?: boolean } = {}) {
104104
}
105105

106106
export function resolveNitroPreset(nitroConfig?: NitroConfig): string {
107+
nitroConfig = nitroConfig || tryUseNuxt()?.options?.nitro
107108
if (provider === 'stackblitz')
108109
return 'stackblitz'
109110
let preset

0 commit comments

Comments
 (0)
Please sign in to comment.