Skip to content

yyyanghj/vsce-pnpm

Repository files navigation

vsce-pnpm

License

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:

  1. npm list fails with npm ERR! missing because pnpm uses a virtual store and symlinked node_modules.
  2. 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 with vsce 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/vsce source (MIT)

Install

pnpm add -D vsce-pnpm
# or
npm i -D vsce-pnpm
# or
yarn add -D vsce-pnpm

Usage

# 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 pack

Force a package manager:

vsce-pnpm pack --pnpm
vsce-pnpm pack --yarn
vsce-pnpm pack --npm

Example:

vsce-pnpm pack --pnpm

Differences vs vsce

  • Only implements package (no publish, 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.

About

VS Code extension packaging tool that reuses the core logic of `vsce pack` and fixes the long‑standing pnpm compatibility gap.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors