npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

upgrade-vite-to-rolldown-vite

v0.0.3

Published

一个用于将 Vite 项目升级到 rolldown-vite 的命令行工具。

Downloads

4

Readme

vite-rolldown-upgrade

一个用于将 Vite 项目升级到 rolldown-vite 的命令行工具。

功能特点

  • 🔄 自动替换 vite 依赖为 rolldown-vite
  • 📦 支持多种包管理器 (npm, yarn, pnpm, bun)
  • 🛠️ 自动处理依赖覆盖配置
  • ⚡ 无缝升级体验

安装

如果你不想全局安装,也可以使用 pnpm dlx 临时执行:

pnpm dlx upgrade-vite-to-rolldown-vite
# 使用 npm
npm install -g vite-rolldown-upgrade

# 使用 yarn
yarn global add vite-rolldown-upgrade

# 使用 pnpm
pnpm add -g vite-rolldown-upgrade

# 使用 bun
bun add -g vite-rolldown-upgrade

使用方法

在你的 Vite 项目根目录下运行:

vite-rolldown-upgrade

命令行选项

Options:
  -s, --skip-install    跳过依赖安装
  -p, --path <path>     指定项目路径 (默认:当前目录)
  -h, --help           显示帮助信息

示例

# 升级当前目录的项目
vite-rolldown-upgrade

# 升级指定路径的项目
vite-rolldown-upgrade -p /path/to/project

# 仅更新配置,不安装依赖
vite-rolldown-upgrade --skip-install

工作原理

该工具会:

  1. 检测项目使用的包管理器
  2. 更新 package.json 中的依赖配置
  3. 根据包管理器添加正确的依赖覆盖配置
  4. 重新安装项目依赖

支持的项目类型

  • 直接使用 Vite 的项目
  • 使用 Vitepress 的项目
  • 其他使用 Vite 作为 peer dependency 的项目

配置示例

直接依赖

{
  "dependencies": {
    "vite": "npm:rolldown-vite@latest"
  }
}

npm/bun 覆盖配置

{
  "overrides": {
    "vite": "npm:rolldown-vite@latest"
  }
}

yarn 覆盖配置

{
  "resolutions": {
    "vite": "npm:rolldown-vite@latest"
  }
}

pnpm 覆盖配置

{
  "pnpm": {
    "overrides": {
      "vite": "npm:rolldown-vite@latest"
    }
  }
}

注意事项

  1. 在升级前请确保已提交或备份了你的代码
  2. 某些 Vite 插件可能尚未完全兼容 rolldown-vite
  3. 如果遇到问题,可以通过移除覆盖配置轻松回退

常见问题

Q: 升级后项目无法启动?

A: 检查是否有使用不兼容的 Vite 插件,可以尝试逐个禁用插件来定位问题。

Q: 如何回退到普通的 Vite?

A: 删除 package.json 中的覆盖配置并重新安装依赖即可。

Q: 支持哪些 Vite 版本?

A: rolldown-vite 目前支持 Vite 7.x 版本。

贡献指南

欢迎提交 Issue 和 Pull Request!

  1. Fork 本仓库
  2. 创建你的特性分支 (git checkout -b feature/AmazingFeature)
  3. 提交你的改动 (git commit -m 'Add some AmazingFeature')
  4. 推送到分支 (git push origin feature/AmazingFeature)
  5. 开启一个 Pull Request

开发

# 安装依赖
npm install

# 开发模式
npm run dev

# 构建
npm run build

许可证

MIT

相关链接