From 76803498738f9e86e7948ce81e01e63607e03549 Mon Sep 17 00:00:00 2001 From: Paul Welsh <1691867+spacedawwwg@users.noreply.github.com> Date: Mon, 4 Nov 2024 10:01:09 +0000 Subject: [PATCH] fix: honor getViteConfig inlineAstroConfig.logLevel setting (#12358) Co-authored-by: Bjorn Lu --- .changeset/cuddly-feet-float.md | 5 +++++ packages/astro/src/config/index.ts | 10 +++------- 2 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 .changeset/cuddly-feet-float.md diff --git a/.changeset/cuddly-feet-float.md b/.changeset/cuddly-feet-float.md new file mode 100644 index 0000000000..8820770c04 --- /dev/null +++ b/.changeset/cuddly-feet-float.md @@ -0,0 +1,5 @@ +--- +'astro': patch +--- + +Honors `inlineAstroConfig` parameter in `getViteConfig` when creating a logger diff --git a/packages/astro/src/config/index.ts b/packages/astro/src/config/index.ts index 3c5faf2fa0..8cfacfdfc4 100644 --- a/packages/astro/src/config/index.ts +++ b/packages/astro/src/config/index.ts @@ -1,6 +1,5 @@ import type { UserConfig as ViteUserConfig } from 'vite'; import type { AstroInlineConfig, AstroUserConfig } from '../@types/astro.js'; -import { Logger } from '../core/logger/core.js'; export function defineConfig(config: AstroUserConfig) { return config; @@ -19,7 +18,7 @@ export function getViteConfig( const [ fs, { mergeConfig }, - { nodeLogDestination }, + { createNodeLogger }, { resolveConfig, createSettings }, { createVite }, { runHookConfigSetup, runHookConfigDone }, @@ -27,16 +26,13 @@ export function getViteConfig( ] = await Promise.all([ import('node:fs'), import('vite'), - import('../core/logger/node.js'), + import('../core/config/logging.js'), import('../core/config/index.js'), import('../core/create-vite.js'), import('../integrations/hooks.js'), import('./vite-plugin-content-listen.js'), ]); - const logger = new Logger({ - dest: nodeLogDestination, - level: 'info', - }); + const logger = createNodeLogger(inlineAstroConfig); const { astroConfig: config } = await resolveConfig(inlineAstroConfig, cmd); let settings = await createSettings(config, userViteConfig.root); settings = await runHookConfigSetup({ settings, command: cmd, logger });