defineConfig always injects vite-plus:vitest-resolver into vp build / vp dev even when Vitest isn't used
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 52/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- bun, typescript
- 領域
- build-system, tooling
調査の方向性
vite-plus から defineConfig をインポートする vite.config.ts で問題を再現し、plugin timings を有効にして vp build を実行します。PR 356 と 1113 の resolver および auto-inline matcher の変更を読み、続いて vp build、vp dev、vp test がそれらをどのように注入するかを追跡します。完了の条件は、テスト以外のコマンドで Vitest 専用のプラグインが発生しなくなるか、文書化された opt-out があることです。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
defineConfig from vite-plus always prepends Vitest-only plugins into every Vite config, including for vp build / vp dev:
vite-plus:vitest-resolvervite-plus:auto-inline-matchervite-plus:coverage-version-guard
Projects that use Vite+ for toolchain (fmt / lint / build) but run tests with another runner (e.g. Bun's bun:test) still pay for these plugins on every production build.
Rolldown/Vite plugin timings report:
[PLUGIN_TIMINGS] Your build spent significant time in plugins. Here is a breakdown:
- vite-plus:vitest-resolver (87%)
The resolver is an enforce: "pre" resolveId hook, so it runs on every module resolve. It early-returns for non-vitest / @vitest/* ids, but with a large graph that still dominates plugin time.
There is no documented opt-out. lazyPlugins only gates user plugins during config-metadata loads; it does not skip these injected plugins on build/dev. vite-plus/prefer-vite-plus-imports also pushes app configs to import defineConfig from vite-plus rather than vite, so switching away isn't a clean escape hatch.
Reproduction
- Use
import { defineConfig } from "vite-plus"in an appvite.config.ts - Do not configure or run
vp test/ Vitest - Run
vp build(with plugin timings enabled) - Observe
vite-plus:vitest-resolvernear the top of[PLUGIN_TIMINGS]
Expected
Vitest helper plugins should only be injected when running tests (vp test / Vitest), or there should be an explicit opt-out for projects that don't use Vitest.
System Info
vite-plus:0.2.5- Tests: Bun (
bun:test), not Vitest - Apps build via
vp build
Suggested fix
- Gate injection on test command / presence of
testconfig, or - Add a config flag such as
test: false/vitest: falseto skip injection, or - Document a supported way to opt out without fighting
prefer-vite-plus-imports
Related
- Implementation that introduced/patched the resolver: https://github.com/voidzero-dev/vite-plus/pull/356
- Auto-inline matcher: https://github.com/voidzero-dev/vite-plus/pull/1113
lazyPlugins(user plugins only): https://github.com/voidzero-dev/vite-plus/pull/1215
- 主要言語
- Rust
- スター
- 6k
- フォーク
- 274
- 平均マージ
- 1日 13時間
- マージ済み PR(30日)
- 195
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-plus のほかの issue
-
`npx --package=vite-plus vp create` fails with exit 127 when npm is the chosen package manager対応中かも @Crimson341 が今日担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
voidzero-dev/vite-plus#2970 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
voidzero-dev/vite-plus#2882 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
voidzero-dev/vite-plus#2097 · コメント 10 件 · リアクション 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Windows: PowerShell installer (1.1.0) does not add vite-plus\bin to user PATH — 'vp' not recognizedオープン
難易度 4/5 3〜5日 初心者へのやさしさ 30/100
voidzero-dev/vite-plus#2984 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
pending triage
難易度 3/5 1〜2日 初心者へのやさしさ 40/100
voidzero-dev/vite-plus#2983 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/vite-plus の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
swc-project/swc#12516 ·
メンテナーはふだん 1 日以内に返信
-
app bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
-
mls-rs-crypto-awslc: exact aws-lc-rs =1.16.3 pin blocks rustls security update対応中かも @muscariello が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
-
[work-item] adam-adae-worsening-emergence: conform spec.yaml to the specification style contract (REQ-1280)対応中かも @muse-yamaa-bot が今日担当しました。 オープンwork-item
難易度 1/5 1〜3時間 初心者へのやさしさ 82/100
メンテナーはふだん 1 日以内に返信