voidzero-dev / voidzero-dev/vite-plus
Revert bundling Vitest directly inside Vite+
- 主要语言
- Rust
- 星标
- 5.8k
- 派生
- 262
- 平均合并
- 23 小时 41 分钟
- 30 天内合并 PR
- 138
描述
### Description
Currently, there is no way to add an import subpath as a package override (example below)
```jsonc
{
"devDependencies": {
"vitest": "npm:vite-plus@0.2.8/test" // doesn't work!
}
}
```
This means that, despite supposedly being compatible with Vitest, packages and integrations may break now due to the absence of a `vitest` package to import from.
### Suggested solution
The old setup of overriding `vitest` with `@voidzero-dev/vite-plus-test` worked fine for this purpose. I propose that we bring it back, at least temporarily, if the Vite+ core team is dead set on bundling it. This way, integrations that check for the `vitest` package still work with Vite+.
### Alternative
Alternatives include migrating the entire ecosystem to use the `vite-plus/test` export which seems unlikely to happen (and also would break compatibility with vanilla Vitest unless packages have to check for both exports, which is another optional peer dependency required to be declared).
### Additional context
This isn't as much of a problem for Vite, tsdown, Rolldown, and Oxlint because their requirements are type-level imports or (in the case of Vite) is already bypassed by overriding the `vite` package. On the other hand, some Vitest reporters rely on extending existing reporters or programmatically running Vitest, which isn't covered in the current export model.
### Validations
- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Confirm this request is for Vite+ itself and not for Vite, Vitest, tsdown, Rolldown, or Oxc.
- [x] Check that there isn't already an issue requesting the same feature.
贡献指南
调研方向
首先跟踪 Vite+ 的包导出和依赖覆盖配置,然后将其与 npm 别名示例以及之前的 @voidzero-dev/vite-plus-test 设置进行比较。当导入或以编程方式使用 vitest 包的集成能够在 Vite+ 下解析,且不要求迁移到 vite-plus/test 时,即视为完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript
- 领域
- developer-experience, tooling
- Issue 类型
- 功能
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 45/100