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:
parent
35795a1a54
commit
7680349873
2 changed files with 8 additions and 7 deletions
5
.changeset/cuddly-feet-float.md
Normal file
5
.changeset/cuddly-feet-float.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Honors `inlineAstroConfig` parameter in `getViteConfig` when creating a logger
|
|
@ -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 });
|
||||
|
|
Loading…
Reference in a new issue