verify for https://github.com/voidzero-dev/vite-plus/pull/1072#pullrequestreview-3985780257
Verification project for PR #1072 review comment: whether root pack array entries cause unintended builds from subpackages.
Created with vp create vite:monorepo, then modified to add a packages/no-config package (no vite.config.ts) and root pack array config.
vp-942-array-test/
├── vite.config.ts # pack: [{ format: ['esm'] }, { format: ['cjs'] }]
├── tsconfig.json
├── pnpm-workspace.yaml
├── verify.mjs # Standalone verification script
├── packages/
│ ├── utils/ # Has its own vite.config.ts (uses local config)
│ │ ├── vite.config.ts
│ │ └── src/index.ts
│ └── no-config/ # No vite.config.ts (uses root config via traverseUp)
│ └── src/index.ts
└── apps/
└── website/
vp install
Run the standalone verification script from each package:
# From no-config (no local vite.config.ts → traverseUp finds root config)
cd packages/no-config
node ../../verify.mjs
# From utils (has local vite.config.ts → uses local config, no traverseUp)
cd ../utils
node ../../verify.mjs
no-config: Root pack array (ESM + CJS) is found via traverseUp, but root stays as cwd so entry: src/index.ts resolves from packages/no-config/src/index.tsutils: Local vite.config.ts is used, traverseUp does not triggersrc/index.tspackages/no-confighasViteConfig(cwd): false
traverseUp found: <root>/vite.config.ts
pack: array with 2 entries
[0] entry: src/index.ts → <root>/packages/no-config/src/index.ts (exists: true)
[1] entry: src/index.ts → <root>/packages/no-config/src/index.ts (exists: true)
packages/utilshasViteConfig(cwd): true
Using local vite.config (no traverseUp needed)
pack: single entry → <root>/packages/utils/src/index.ts (exists: true)
The Codex concern about sibling packages being built is not an issue because root stays as cwd. All path resolution happens relative to the subpackage directory, not the root. When invoked via vp run, vite-task’s caching also prevents unnecessary rebuilds.
We use cookies
We use cookies to analyze traffic and improve your experience. You can accept or reject analytics cookies.