feat(vite-plus): support lazy field in vite-plus config#526
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ccdd0d83ad
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
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".
There was a problem hiding this comment.
Pull request overview
This pull request adds support for a lazy field in the vite-plus configuration to enable lazy loading of plugins. The PR modifies the defineConfig function to intercept configurations with a lazy field, execute the lazy loader, and merge the resulting plugins with any existing plugins before passing the config to the underlying vite/vitest configuration system.
Changes:
- Modified
vite.config.tsto use the newdefineConfigfunction instead of type assertion - Updated
pnpm-workspace.yamlwith formatting improvements and added@vitejs/plugin-reactto the catalog - Implemented lazy plugin loading support in
packages/cli/src/index.tswith a customdefineConfigwrapper
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| vite.config.ts | Updated to use defineConfig function call instead of type assertion to leverage the new lazy loading feature |
| pnpm-workspace.yaml | Formatting improvements (quote normalization, whitespace consistency), added @vitejs/plugin-react dependency, and alphabetized patchedDependencies entries |
| packages/cli/src/index.ts | Added lazy field to UserConfig interface and implemented custom defineConfig wrapper to handle lazy plugin loading |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ccdd0d8 to
5380304
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 4 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
Merge activity
|

Note
Medium Risk
Adds new config evaluation behavior that can change when/which plugins are included, and adjusts CLI build output (new CJS artifact) and CI build ordering; mistakes here could break consumer configs or packaging.
Overview
Adds a custom
defineConfigwrapper invite-plusthat supports alazy()field to asynchronously provide additional plugins and merges them with any existingplugins, working for object, promise, and function config forms.Updates the CLI entrypoints and build to ship
define-configfor both ESM and CommonJS (emittingdefine-config.cjs), and adds thorough unit coverage for the newlazybehavior.Adjusts CI build steps so
vite-plus/vite-plus-cliTypeScript builds run earlier, updates the repovite.config.tsto usedefineConfig, and makes small workspace/lint script tweaks.Written by Cursor Bugbot for commit 2f8417b. This will update automatically on new commits. Configure here.