vsce-pnpm
v0.1.0
Published
VS Code extension packaging tool that reuses the core logic of `vsce pack` and fixes the long‑standing pnpm compatibility gap.
Readme
vsce-pnpm
VS Code extension packaging tool that reuses the core logic of vsce pack and fixes the long‑standing pnpm compatibility gap.
Why this exists
The official @vscode/vsce package assumes npm-style dependency layouts and calls npm list internally. In pnpm projects this causes two major problems:
npm listfails withnpm ERR! missingbecause pnpm uses a virtual store and symlinkednode_modules.- pnpm dependency symlinks are not respected, so authors are forced to bundle dependencies and use
vsce --no-dependencies, which is inconvenient and diverges from normal workflows.
vsce-pnpm keeps the packaging behavior you already know, but adds correct dependency resolution for pnpm (including monorepos) and supports npm/yarn/pnpm consistently.
Features
- One command only:
vsce-pnpm, flags compatible withvsce pack - Auto-detects npm / yarn / pnpm
- Manual override via
--npm/--yarn/--pnpm - Proper pnpm dependency resolution (virtual store + symlinks)
- Friendly error messages and clear logs
- Based on
@vscode/vscesource (MIT)
Install
pnpm add -D vsce-pnpm
# or
npm i -D vsce-pnpm
# or
yarn add -D vsce-pnpmUsage
# inside your extension project
pnpm exec vsce-pnpm pack
# or npm / yarn
npm exec vsce-pnpm pack
yarn vsce-pnpm pack
# global install
vsce-pnpm packForce a package manager:
vsce-pnpm pack --pnpm
vsce-pnpm pack --yarn
vsce-pnpm pack --npmExample:
vsce-pnpm pack --pnpmDifferences vs vsce
- Only implements
package(nopublish, no marketplace auth) - Correct pnpm dependency resolution (virtual store + symlinks)
- Monorepo-friendly lockfile discovery
- Uses the same flags as
vsce package, but logs/errors are more explicit
FAQ
Why not just use @vscode/vsce?
If you use pnpm, vsce relies on npm list and npm-style layouts. This causes missing dependency errors and forces you to bundle dependencies manually. vsce-pnpm removes that friction while preserving the same packaging behavior.
Does this change what gets packaged?
It follows the same file collection logic as vsce package, but resolves dependencies in a pnpm-compatible way. If you already use .vscodeignore, it will be respected.
What about multiple versions of a dependency?
vsce-pnpm keeps pnpm’s nested dependency layout inside the VSIX so each version can be resolved at runtime.
Why require a lockfile? Lockfiles are the only reliable source for deterministic dependency resolution across npm/yarn/pnpm. Without them, the packaged output is not reproducible.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License - see the LICENSE file for details.
