import-cost-server
v0.0.4
Published
LSP server that displays import bundle sizes via inlay hints
Readme
import-cost-server
LSP server that powers the Import Cost extension for Zed.
Displays inline bundle sizes for JavaScript and TypeScript imports using LSP inlay hints.
How it works
- Parses import statements (
importandrequire()) using the TypeScript compiler API - Bundles each import with esbuild (minified, tree-shaken)
- Measures raw and gzipped output size
- Returns sizes as
textDocument/inlayHintLSP responses
Skips type-only imports, relative imports, and Node.js builtins. Results are cached with a 5-minute TTL.
Usage
This package is installed and launched automatically by the Import Cost Zed extension. You don't need to install it manually.
The server resolves packages from the project's node_modules, so your project dependencies need to be installed (npm install / yarn / pnpm install).
License
MIT
