Skip to content

fix(config): pass logLevel to rolldown during config bundling (fix #21971)#22021

Open
cyphercodes wants to merge 2 commits into
vitejs:mainfrom
cyphercodes:fix-silent-loglevel-config
Open

fix(config): pass logLevel to rolldown during config bundling (fix #21971)#22021
cyphercodes wants to merge 2 commits into
vitejs:mainfrom
cyphercodes:fix-silent-loglevel-config

Conversation

@cyphercodes

@cyphercodes cyphercodes commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

This PR fixes #21971 where resolveConfig({ logLevel: 'silent' }) was not suppressing Rolldown warnings during config file bundling.

Problem

When using resolveConfig({ logLevel: 'silent' }), Rolldown warnings were still being displayed during the config file bundling process. This happened because the logLevel option was not being passed to the rolldown() call in bundleConfigFile.

Solution

  • Modified bundleConfigFile to accept an optional logLevel parameter
  • Modified bundleAndLoadConfigFile to accept and forward logLevel
  • Updated the call site in loadConfigFromFile to pass logLevel to the bundler
  • The logLevel is now passed directly to the rolldown() call, which respects the 'silent' setting

Changes

  • packages/vite/src/node/config.ts: Added logLevel parameter to bundleConfigFile and bundleAndLoadConfigFile, passed it to the rolldown() call

Tested locally by running the existing config tests - all 63 tests pass.

@cyphercodes

Copy link
Copy Markdown
Contributor Author

Pushed a follow-up fix in 94c220e to map Vite's logLevel: 'error' to Rolldown's supported 'silent' level during config bundling. This resolves the TypeScript/runtime failures where Rolldown rejected 'error' as an input log level.\n\nVerification:\n- pnpm run build\n- pnpm run typecheck\n- pnpm eslint --cache --concurrency auto packages/vite/src/node/config.ts\n- pnpm prettier --check packages/vite/src/node/config.ts\n- targeted failing e2e suites: pnpm vitest run -c vitest.config.e2e.ts playground/ssr/__tests__/ssr.spec.ts playground/ssr-conditions/__tests__/ssr-conditions.spec.ts playground/ssr-noexternal/__tests__/ssr-noexternal.spec.ts playground/ssr-wasm/__tests__/ssr-wasm.spec.ts\n\nThe latest GitHub checks for 94c220e are green (CI Lint and all Build&Test matrix jobs passed).

@bluwy
bluwy requested a review from sapphi-red May 12, 2026 08:22
@sapphi-red

Copy link
Copy Markdown
Member

It doesn't feel right to do this for me: #21971 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

resolveConfig({ logLevel: 'silent' }) does not suppress Rolldown warnings during config file bundling

3 participants