Skip to content

Commit 7587b2a

Browse files
authored
fix: support nitro preset detection in zero config environments (#216)
1 parent 07fb504 commit 7587b2a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/module.ts

+5-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ export default defineNuxtModule<ModuleOptions>({
6565
if (serverBundle === 'auto') {
6666
serverBundle = nuxt.options.dev
6767
? 'local'
68-
: KEYWORDS_EDGE_TARGETS.some(word => typeof nuxt.options.nitro.preset === 'string' && nuxt.options.nitro.preset.includes(word))
68+
: KEYWORDS_EDGE_TARGETS.some(word =>
69+
(typeof nuxt.options.nitro.preset === 'string' && nuxt.options.nitro.preset.includes(word))
70+
|| process.env.NITRO_PRESET?.includes(word)
71+
|| process.env.SERVER_PRESET?.includes(word),
72+
)
6973
? 'remote'
7074
: 'local'
7175
logger.info(`Nuxt Icon server bundle mode is set to \`${serverBundle}\``)

0 commit comments

Comments
 (0)