Skip to content

Commit

Permalink
fix: honor getViteConfig inlineAstroConfig.logLevel setting (#12358)
Browse files Browse the repository at this point in the history
Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
  • Loading branch information
spacedawwwg and bluwy authored Nov 4, 2024
1 parent 35795a1 commit 7680349
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/cuddly-feet-float.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Honors `inlineAstroConfig` parameter in `getViteConfig` when creating a logger
10 changes: 3 additions & 7 deletions packages/astro/src/config/index.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -19,24 +18,21 @@ export function getViteConfig(
const [
fs,
{ mergeConfig },
{ nodeLogDestination },
{ createNodeLogger },
{ resolveConfig, createSettings },
{ createVite },
{ runHookConfigSetup, runHookConfigDone },
{ astroContentListenPlugin },
] = 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 });
Expand Down

0 comments on commit 7680349

Please sign in to comment.