0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

fix: honor getViteConfig inlineAstroConfig.logLevel setting (#12358)

Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com>
This commit is contained in:
Paul Welsh 2024-11-04 10:01:09 +00:00 committed by GitHub
parent 35795a1a54
commit 7680349873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 7 deletions

View file

@ -0,0 +1,5 @@
---
'astro': patch
---
Honors `inlineAstroConfig` parameter in `getViteConfig` when creating a logger

View file

@ -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 });