Skip to content

feat: add Vite+ as an experimental unified toolchain option - #1175

Open
btea wants to merge 5 commits into
mainfrom
feat/vite-plus-toolchain
Open

btea wants to merge 5 commits into
mainfrom
feat/vite-plus-toolchain

Conversation

@btea

@btea btea commented Nov 1, 2026

Copy link
Copy Markdown
Collaborator

Description

close #1168 cc @liangmiQwQ

@haoqunjiang

haoqunjiang commented Nov 10, 2026 •

Copy link
Copy Markdown
Member

(This comment is posted by Claude Code on my behalf)

Thanks for working on this! The mechanics are a good base: no vp migrate at scaffold time, the placement in the experimental list, and the vite alias (which matches Vite+'s own migration rules) all look right to me. There are a few design and correctness points I'd like to see addressed before merging, though.

Design

  1. Gate the prompt. The experimental entry should only be shown when the global vp binary is found (on PATH, or under VP_HOME / ~/.vite-plus/bin). Users who don't have Vite+ installed should see no change in the prompts. The explicit --vite-plus flag can keep working for everyone.

  2. Separate "launched by Vite+" from the feature flag. --vite-plus is in FEATURE_FLAGS, so passing it skips all the interactive prompts. That means vp create vue can't simply pass this flag, or users would get a default project without being asked anything. We need a signal that turns Vite+ on while the other prompts still run, e.g. an environment variable set by vp create. In that case the Vite+ entry itself doesn't need to be shown.

  3. Make lint and format implied under Vite+. Oxlint and Oxfmt ship inside vite-plus, so vp lint and vp fmt scripts and their config should always be generated. Currently vp lint only appears if ESLint was selected, and vp fmt only if Oxfmt was.

  4. Drop ESLint and Prettier on this path. vp lint is Oxlint-only and vp fmt is Oxfmt, so the ESLint and Prettier templates should be skipped when Vite+ is on. (This also avoids the unmet oxlint peer of eslint-plugin-oxlint, and having to keep its version in lockstep with the Oxlint version bundled in vite-plus.) In the prompt path, print a short note that they were replaced; for conflicting flags such as --vite-plus --eslint, warn and ignore the conflicting one. When launched by vp create vue, the Linter / Prettier / Oxfmt entries can be hidden altogether.

  5. Move the config into vite.config. Vite+'s docs recommend against vitest.config.*, .oxlintrc.json and .oxfmtrc.json. The generated project should use the test, lint and fmt blocks in vite.config, with defineConfig imported from vite-plus.

Correctness

  1. Peer ranges outside pnpm. @vitejs/plugin-vue expects vite@^5 || ^6 || ^7 || ^8, while the core alias is versioned 1.x. Only pnpm gets a peerDependencyRules relaxation here. Could you confirm that installation is clean on npm, yarn and bun as well?

Non-blocking

  1. Version of the core alias. The alias version lives in a TypeScript constant that Renovate won't see, so it will go stale silently. It's not a big problem in practice: both ranges are carets on packages released in lockstep, and vp create re-pins them anyway when the project is created through Vite+. Still, it would be nice to declare the aliased vite entry in the template's package.json next to vite-plus and read the spec from the manifest in applyOverrides, so that Renovate keeps both up to date.

@haoqunjiang

Copy link
Copy Markdown
Member

@liangmiQwQ

I found a few issues during the review process, so it would be great if the Vite+ team could confirm a couple of things:

    • Separate "launched by Vite+" from the feature flag. --vite-plus is in FEATURE_FLAGS, so passing it skips all the interactive prompts. That means vp create vue can't simply pass this flag, or users would get a default project without being asked anything. We need a signal that turns Vite+ on while the other prompts still run, e.g. an environment variable set by vp create. In that case the Vite+ entry itself doesn't need to be shown.

Is there currently such an environment variable available in Vite+?

  1. Regarding vp migrate, I noticed that during the initial project creation, since create-vue also generates vscode settings, I'm prompted to decide what to do with these files, with skip being the default option. I don't think it's the best onboarding experience for new users. IMO we should skip the prompt and just merge the templates if vp migrate is called from vp create:
Image

@liangmiQwQ

Copy link
Copy Markdown
  1. Not for now, and that becomes a problem. I agree with you so Vite+ team is finding a way to add env variables for this case.
  2. I'm working on a change, that let vp create skips the migration steps if the create-xxx cli already generates a Vite+ project.

Let's continue this PR after these upstream changes.

(Really apologize for my late reply, I somehow missed the notification 🙇🙇)

fengmk2 added a commit to voidzero-dev/vite-plus that referenced this pull request Nov 12, 2026
)

The current `vp create` always migrates the project generated by a
third-party `create-xxx` CLI: it migrates ESLint/Prettier/tsup and
rewrites the project for Vite+. When the CLI already generates a Vite+
project (for example, the upcoming Vite+ option in create-vue,
vuejs/create-vue#1175), this overrides choices the template made on
purpose, such as keeping ESLint or its `vite-plus` version.

This PR makes `vp create` skip these migration steps when the generated
standalone project already depends on `vite-plus`. Follows `vp
migrate`'s behavior for projects that already use Vite+.

- Only third-party templates are affected. Built-in and bundled
templates still rely on the rewrite.
- Packages created inside a monorepo are still rewritten so they use the
workspace catalog.
- `VP_FORCE_MIGRATE=1` still runs the full migration.
- Git, hooks, agent instructions, editor configs, the package manager
pin, and install still run as before.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
@liangmiQwQ

Copy link
Copy Markdown

Update:

Comment thread utils/vitePlus.ts Resolved
Comment thread template/base/vite.config.js.ejs Resolved
Comment thread utils/vitePlus.ts Resolved
@btea

btea commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for reviewing. I've updated it.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to choose Vite+ as project toolchain

3 participants