Fix logLevel passed to Vite build (#8678)
This commit is contained in:
parent
aad756297c
commit
e8495c853b
3 changed files with 9 additions and 4 deletions
5
.changeset/fast-glasses-remain.md
Normal file
5
.changeset/fast-glasses-remain.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
'astro': patch
|
||||
---
|
||||
|
||||
Fix logLevel passed to Vite build
|
|
@ -154,7 +154,8 @@ async function ssrBuild(
|
|||
const viteBuildConfig: vite.InlineConfig = {
|
||||
...viteConfig,
|
||||
mode: viteConfig.mode || 'production',
|
||||
logLevel: opts.viteConfig.logLevel ?? 'error',
|
||||
// Check using `settings...` as `viteConfig` always defaults to `warn` by Astro
|
||||
logLevel: settings.config.vite.logLevel ?? 'error',
|
||||
build: {
|
||||
target: 'esnext',
|
||||
// Vite defaults cssMinify to false in SSR by default, but we want to minify it
|
||||
|
@ -260,7 +261,8 @@ async function clientBuild(
|
|||
const viteBuildConfig: vite.InlineConfig = {
|
||||
...viteConfig,
|
||||
mode: viteConfig.mode || 'production',
|
||||
logLevel: 'info',
|
||||
// Check using `settings...` as `viteConfig` always defaults to `warn` by Astro
|
||||
logLevel: settings.config.vite.logLevel ?? 'info',
|
||||
build: {
|
||||
target: 'esnext',
|
||||
...viteConfig.build,
|
||||
|
|
|
@ -243,8 +243,6 @@ export async function createVite(
|
|||
}
|
||||
result = vite.mergeConfig(result, commandConfig);
|
||||
|
||||
result.customLogger = vite.createLogger(result.logLevel ?? 'warn');
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue