Repository navigation
fix(cli): load task and tool metadata without resolving Vite - #3187
Open
jasonkuhrt wants to merge 1 commit into
Open
jasonkuhrt wants to merge 1 commit into
jasonkuhrt wants to merge 1 commit into
Conversation
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Reading task or tool settings from
vite.config.*currently runs Vite's full config-resolution pipeline. A plugin'sconfigorconfigResolvedhook can therefore fail a metadata read, and Vite resolves dev-server options that the metadata consumer never uses.Issue #2845 traced this path to the read of pnpm's
node_modules/.modules.yaml. Automatic task input tracking originally made changes to installation timestamps and machine-specific paths invalidate cached tasks. Current main already contains vite-task#850, which fingerprints only the manifest's existence. This change removes the unnecessary resolution path itself.Use Vite's public
loadConfigFromFileinside the existing metadata-resolution guard. Preserve config discovery, workspace traversal, the loaded config path, async/function configs, and the existingbuild/developmentevaluation defaults. PreserveNODE_ENVinitialization, including Vite Task's tracked environment lookup. Return the user config instead of a fully resolved Vite config.The public
resolveConfigexport and dev/build/preview paths retain full resolution. Metadata fields supplied by plugin hooks will no longer be populated on this path.Validation
pnpm -F vite-plus build: passed, including JS/declarations and the native binding.vp test run packages/cli: 90 files passed; 2,370 tests passed, one skipped.pnpm test:unit: 113 files passed; 2,557 tests passed, one skipped.vp checkandpnpm tsgo: passed.server.fs.allow.Oxlint and Oxfmt need a separate Oxc change: their shared loader calls the public
resolveConfigexport directly and does not use this internal helper.Refs #2845