You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 thelogLeveloption was not being passed to therolldown()call inbundleConfigFile.Solution
bundleConfigFileto accept an optionallogLevelparameterbundleAndLoadConfigFileto accept and forwardlogLevelloadConfigFromFileto passlogLevelto the bundlerlogLevelis now passed directly to therolldown()call, which respects the 'silent' settingChanges
packages/vite/src/node/config.ts: AddedlogLevelparameter tobundleConfigFileandbundleAndLoadConfigFile, passed it to therolldown()callTested locally by running the existing config tests - all 63 tests pass.