mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-25 23:22:02 +00:00
fix(nuxt): set nitro log level to match nuxt options (#25213)
This commit is contained in:
parent
97db0fada7
commit
2de774d95a
@ -11,7 +11,7 @@ import escapeRE from 'escape-string-regexp'
|
||||
import { defu } from 'defu'
|
||||
import fsExtra from 'fs-extra'
|
||||
import { dynamicEventHandler } from 'h3'
|
||||
import type { Nuxt, RuntimeConfig } from 'nuxt/schema'
|
||||
import type { Nuxt, NuxtOptions, RuntimeConfig } from 'nuxt/schema'
|
||||
// @ts-expect-error TODO: add legacy type support for subpath imports
|
||||
import { template as defaultSpaLoadingTemplate } from '@nuxt/ui-templates/templates/spa-loading-icon.mjs'
|
||||
import { version as nuxtVersion } from '../../package.json'
|
||||
@ -19,6 +19,12 @@ import { distDir } from '../dirs'
|
||||
import { toArray } from '../utils'
|
||||
import { ImportProtectionPlugin, nuxtImportProtections } from './plugins/import-protection'
|
||||
|
||||
const logLevelMapReverse = {
|
||||
silent: 0,
|
||||
info: 3,
|
||||
verbose: 3
|
||||
} satisfies Record<NuxtOptions['logLevel'], NitroConfig['logLevel']>
|
||||
|
||||
export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
// Resolve config
|
||||
const _nitroConfig = ((nuxt.options as any).nitro || {}) as NitroConfig
|
||||
@ -218,7 +224,8 @@ export async function initNitro (nuxt: Nuxt & { _nitro?: Nitro }) {
|
||||
rollupConfig: {
|
||||
output: {},
|
||||
plugins: []
|
||||
}
|
||||
},
|
||||
logLevel: logLevelMapReverse[nuxt.options.logLevel],
|
||||
} satisfies NitroConfig)
|
||||
|
||||
// Resolve user-provided paths
|
||||
|
Loading…
Reference in New Issue
Block a user