GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix(cli): load task and tool metadata without resolving Vite by jasonkuhrt · Pull Request #3187 · voidzero-dev/vite-plus

Conversation

@jasonkuhrt

@jasonkuhrt jasonkuhrt commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Reading task or tool settings from vite.config.* currently runs Vite's full config-resolution pipeline. A plugin's config or configResolved hook 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 loadConfigFromFile inside the existing metadata-resolution guard. Preserve config discovery, workspace traversal, the loaded config path, async/function configs, and the existing build / development evaluation defaults. Preserve NODE_ENV initialization, including Vite Task's tracked environment lookup. Return the user config instead of a fully resolved Vite config.

The public resolveConfig export 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 check and pnpm tsgo: passed.
  • Eight new cases cover skipped plugin hooks, equal metadata across equivalent pnpm manifest states, async-config environment defaults, missing configs, workspace traversal, and full resolution after metadata loading.
  • The two central regressions fail with the original loader and pass with this change. Full-resolution controls still run plugin hooks and include each installation's virtual-store path in server.fs.allow.

Oxlint and Oxfmt need a separate Oxc change: their shared loader calls the public resolveConfig export directly and does not use this internal helper.

Refs #2845

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
jasonkuhrt added 2 commits October 22, 2026 01:01
@jasonkuhrt
fix(cli): load task and tool metadata without resolving Vite
adf3071
@jasonkuhrt
Merge branch 'main' into metadata-only-config-loading
1857f9e
@fengmk2

fengmk2 commented Nov 21, 2026

Copy link
Copy Markdown
Member

@jasonkuhrt can you handle the conflicts before I start review it.

jasonkuhrt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@fengmk2 fengmk2 self-assigned this Nov 21, 2026
@jasonkuhrt

jasonkuhrt commented Nov 21, 2026

Copy link
Copy Markdown
Contributor Author

Written by an AI agent (Claude) on behalf of @jasonkuhrt.

@fengmk2 thanks. Resolving the conflicts showed that the conflict is about behavior, not just text, so I'm closing this PR instead of merging main into it.

#3249 (merged 2026-10-28) made metadata reads keep plugin apply, config and configResolved hooks. Its config_resolution_hooks snapshots check that vp staged and vp pack use the staged and pack config a plugin's config hook returns. This PR loads the config with loadConfigFromFile, which never runs plugin hooks (in Vite they run only in resolveConfig), so those snapshots would fail. Its own description already said that plugin-supplied metadata would no longer be filled in on this path.

The cache misses that motivated it (#2845) come from fingerprinting node_modules/.modules.yaml. vite-task#850 already changed that to fingerprint only whether the file exists, so this PR isn't needed for that fix.

fengmk2 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@jasonkuhrt jasonkuhrt closed this Nov 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@fengmk2 fengmk2

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@jasonkuhrt @fengmk2
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.