voidzero-dev / voidzero-dev/vite-plus

`vp dev`& `vp build` break argv passthrough by stripping the `--` separator

Abierto
#2,250 0 comentarios 0 reacciones 2 asignados Reclamado por @wan9chi Ver en GitHub
bug
Lenguaje dominante
Rust
Estrellas
5.8k
Forks
262
Merge medio
23 h 41 min
PR fusionados (30 d)
138

Descripción

### Describe the bug

Every `vp` CLI layer consumes one `--` argument separator, so passthrough args that Vite leaves in `process.argv` for `vite.config.ts` to read never arrive. Actually the flags after the stripped `--` even get misparsed as Vite positionals.

With plain Vite, `vite build -- --app web` keeps `--app web` out of option parsing and visible in `process.argv` (often sude to parameterize a single hoisted config in a monorepo).

But in `vp` this is broken:

| Command | Result |
| --- | --- |
| `vp build -- --app web` | broken: `--` stripped, Vite parses `--app web`, **`web` becomes the build root** (`Cannot resolve entry module web/index.html`), the project config never loads |
| `vp build -- -- --app web` | still broken: second `--` stripped too |
| `vp build -- -- -- --app web` | works: config sees `ARGV=["build","--","--app","web"]` |

So global `vp` needs three `--` where Vite needs one, and a project-local `vp` needs two.

Expected: `vp dev -- --app` / `vp build -- --app` behave exactly like `vite dev -- --app` — one `--`, trailing args preserved in the spawned Vite process's `process.argv`.

### Reproduction

See steps below (three files, no dependencies).

### Steps to reproduce

```bash
mkdir repro && cd repro
cat > package.json <<'PKG'
{ "name": "repro", "private": true, "type": "module" }
PKG
cat > vite.config.ts <<'CFG'
console.log('ARGV=' + JSON.stringify(process.argv.slice(2)));
export default {};
CFG
cat > index.html <<'HTML'
hi
HTML

vp build -- --app web # fails: Cannot resolve entry module web/index.html, no ARGV log
vp build -- -- -- --app web # works: ARGV=["build","--","--app","web"]
```

### System Info

```shell
vp v0.2.2 (global), macOS (Darwin 25.5.0)
Also reproducible on main
```

### Used Package Manager

pnpm

### Logs

### Validations

- [x] Read the [Contributing Guidelines](https://github.com/voidzero-dev/vite-plus/blob/main/CONTRIBUTING.md).
- [x] Check that there isn't [already an issue](https://github.com/voidzero-dev/vite-plus/issues) for the same bug.
- [x] Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- [x] The provided reproduction is a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example).

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.