Skip to content

入门

🌐 Getting Started

Vite+ 是用于网页开发的统一工具链和入口。它通过结合 ViteVitestOxlintOxfmtRolldowntsdownVite Task,在一个地方管理你的运行时、包管理器和前端工具链。

🌐 Vite+ is the unified toolchain and entry point for web development. It manages your runtime, package manager, and frontend toolchain in one place by combining Vite, Vitest, Oxlint, Oxfmt, Rolldown, tsdown, and Vite Task.

Vite+ 分为两个部分:vp,全局命令行工具,以及 vite-plus,安装在每个项目中的本地包。如果你已经有一个 Vite 项目,可以使用 vp migrate 将其迁移到 Vite+,或将我们的 迁移提示 粘贴到你的编码代理中。

🌐 Vite+ ships in two parts: vp, the global command-line tool, and vite-plus, the local package installed in each project. If you already have a Vite project, use vp migrate to migrate it to Vite+, or paste our migration prompt into your coding agent.

安装 vp

🌐 Install vp

macOS / Linux

bash
curl -fsSL https://vite.plus | bash

Windows

powershell
irm https://vite.plus/ps1 | iex

安装完成后,打开一个新的终端并运行:

🌐 After installation, open a new shell and run:

bash
vp help

INFO

Vite+ 将管理你的全局 Node.js 运行时和包管理器。如果你想退出此行为,请运行 vp env off。如果你觉得 Vite+ 不适合你,请输入 vp implode,但请 与我们分享你的反馈

使用较小的平台(CPU 架构、操作系统)?

预构建的二进制文件针对以下平台分发(按 Node.js v24 平台支持层级 分组):

🌐 Prebuilt binaries are distributed for the following platforms (grouped by Node.js v24 platform support tier):

  • 一级
    • Linux x64 glibc(x86_64-unknown-linux-gnu
    • Linux arm64 glibc(aarch64-unknown-linux-gnu
    • Windows x64(x86_64-pc-windows-msvc
    • macOS x64(x86_64-apple-darwin
    • macOS arm64(aarch64-apple-darwin
  • 二级
    • Windows arm64(aarch64-pc-windows-msvc
  • 实验性的
    • Linux x64 musl(x86_64-unknown-linux-musl
  • 其他
    • Linux arm64 musl(aarch64-unknown-linux-musl

如果你的平台没有可用的预构建二进制文件,安装将会失败并出现错误。

🌐 If a prebuilt binary is not available for your platform, installation will fail with an error.

在 Alpine Linux(musl)上,你需要在使用 Vite+ 之前安装 libstdc++

🌐 On Alpine Linux (musl), you need to install libstdc++ before using Vite+:

sh
apk add libstdc++

这是必须的,因为受管理的 非官方构建 Node.js 运行时依赖于 GNU C++ 标准库。

🌐 This is required because the managed unofficial-builds Node.js runtime depends on the GNU C++ standard library.

快速开始

🌐 Quick Start

创建一个项目,安装依赖,并使用默认命令:

🌐 Create a project, install dependencies, and use the default commands:

bash
vp create # Create a new project
vp install # Install dependencies
vp dev # Start the dev server
vp check # Format, lint, type-check
vp test # Run JavaScript tests
vp build # Build for production

你也可以单独运行 vp 并使用交互式命令行。

🌐 You can also just run vp on its own and use the interactive command line.

核心命令

🌐 Core Commands

Vite+ 可以处理整个本地前端开发周期,从启动项目、开发、检查和测试,到为生产构建。

🌐 Vite+ can handle the entire local frontend development cycle from starting a project, developing it, checking & testing, and building it for production.

开始

🌐 Start

  • vp create 创建新的应用、软件包和单体仓库。
  • vp migrate 将现有项目迁移到 Vite+。
  • vp config 配置提交钩子和代理集成。
  • vp staged 对暂存的文件运行检查。
  • vp install 使用正确的包管理器安装依赖。
  • vp env 管理 Node.js 版本。

开发

🌐 Develop

  • vp dev 启动由 Vite 提供支持的开发服务器。
  • vp check 一起运行格式化、代码规范检查和类型检查。
  • vp lintvp fmtvp test 让你直接运行那些工具。

执行

🌐 Execute

  • vp run 在工作区中运行任务并使用缓存。
  • vp cache 清除任务缓存条目。
  • vpx 全局运行二进制文件。
  • vp exec 运行本地项目二进制文件。
  • vp dlx 运行软件包二进制文件而不将它们添加为依赖。

构建

🌐 Build

管理依赖

🌐 Manage Dependencies

维护

🌐 Maintain

  • vp upgrade 会更新 vp 本身的安装。
  • vp implode 会从你的计算机中删除 vp 及相关的 Vite+ 数据。

INFO

Vite+ 自带许多预定义命令,例如 vp buildvp testvp dev。这些命令是内置的,无法更改。如果你想从你的 package.json 脚本运行命令,请使用 vp run <command>

了解更多关于 vp run 的信息。