fix(cli): skip lazyPlugins only while resolving config metadata#1939
Merged
Conversation
✅ Deploy Preview for viteplus-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Contributor
|
✅ Staging deployment successful! Preview: https://viteplus-staging.void.app/ |
1319bd1 to
aca3722
Compare
This comment was marked as resolved.
This comment was marked as resolved.
aca3722 to
a79255d
Compare
a79255d to
e908163
Compare
This comment was marked as resolved.
This comment was marked as resolved.
e908163 to
d794602
Compare
a09b307 to
9b8126a
Compare
This comment was marked as resolved.
This comment was marked as resolved.
Member
Author
|
@codex review |
lazyPlugins decided whether to run the user's plugin factory from VP_COMMAND. That signal is overloaded (the `vp run` task-discovery read and a verbatim build child both see `run`), unnormalized (the `vp format` alias is `format`, not `fmt`), and inherited by spawned children. As a result a Vite build spawned under `vp run` (a verbatim `node build.mjs` task) or `vp exec` built without the user's plugins, while `vp format` wrongly loaded them. Decide from the resolution intent instead: the metadata resolvers (resolveViteConfig, migrate's rolldown-compat check, and the oxlint/oxfmt subprocess) mark that the config is being loaded only to read a config block, and lazyPlugins skips the factory only while that marker is set. The default is to load, so dev/build/test/preview and any spawned build keep their plugins. VP_COMMAND had no other reader, so it is removed.
9b8126a to
ec0a6dd
Compare
Member
Author
|
@codex review |
|
Codex Review: Didn't find any major issues. Another round soon, please! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
cpojer
approved these changes
Jun 25, 2026
sapphi-red
approved these changes
Jun 25, 2026
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.
Problem
lazyPluginsdecided whether to run the user's plugin factory fromVP_COMMAND. That signal is:vp run's task-discovery config read and a verbatim build child both seerun;vp formatalias isformat, notfmt;So a Vite build spawned under
vp run(a verbatimnode build.mjstask) orvp execbuilt without the user's plugins, whilevp formatwrongly loaded them. (Both were raised in review.)Fix
Decide from the resolution intent instead of the command name. The metadata resolvers (
resolveViteConfig, migrate's rolldown-compat check, and the oxlint/oxfmt subprocess) mark that the config is being loaded only to read a config block, andlazyPluginsskips the factory only while that marker is set.The default is to load, so
dev/build/test/previewand any spawned build keep their plugins, regardless of which command launched them. The marker is scoped to the resolution, so it never leaks to task children, and it's immune to aliases and not-yet-known commands.VP_COMMANDhad no other reader, so it's removed.Adds snap tests for the two fixed cases (verbatim
vp runbuild loads plugins;vp formatskips them) plus updated unit tests and docs.