Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
I

import-cost

> 数据库
Open source

displays the import size of the package you are importing inside the code editor

1.4K stars0 likes4 views
WebsiteGitHub

About

displays the import size of the package you are importing inside the code editor

Import Cost

This extension will display inline in the editor the size of the imported package. The extension utilizes webpack in order to detect the imported size.

This project includes implementation of:

  • Import Cost VSCode extension - install it from VSCode Marketplace
  • Import Cost Node module - use freely to implement extensions for other IDE (or contribute them to this repository)

Enjoy!

Third-Party Editor Plugin Links

  • Jetbrains IDE Plugin
  • Atom Package
  • Vim Plugin (coc.nvim extension)
  • Vim Plugin

Why & How

We detail the why and how in this blog post: https://citw.dev/posts/import-cost

Developer guidelines

In this project we use npm workspaces for managing the multiple packages.

Getting started

In order to start working all you need to do is:

bash
$ git clone [email protected]:wix/import-cost.git
$ npm install
$ code packages/import-cost
$ code packages/vscode-import-cost

Once VSCode workspaces are open:

  • Hit F5 to run tests in import-cost
  • Hit F5 to run the vscode-import-cost extension in debug mode

Applying changes

Thanks to npm workspaces, we have a symbolic link in the vscode-import-cost node modules folder to the local import-cost, which makes applying changes very easy. You can verify that link exists by running the following command:

bash
$ ls -la packages/vscode-import-cost/node_modules | grep import-cost
lrwxr-xr-x    1 shahar  staff    17 Aug  6 09:38 import-cost -> ../../import-cost

If anything goes wrong and link does not exist, just run the following commands at the root of this project and npm will sort it out:

bash
$ git clean -xdf
$ npm install

After you make any changes to the import-cost node module, don't forget to trigger transpilation in order to see those changes when running the vscode-import-cost extension:

bash
$ npm test

Publishing changes

When you are ready to publish a new version of the extension, you first need to publish a new version of import-cost (unless nothing changed there). This is done by first commiting all your changes, then simply run the following commands:

bash
$ cd packages/import-cost
$ npm version patch | minor | major
$ git commit -a -m "releasing version X.X.X"
$ git push
$ npm publish

Then go ahead and release the extension with almost same steps (except for last one):

bash
$ cd packages/vscode-import-cost
$ npm version patch | minor | major
$ git commit -a -m "releasing version X.X.X"
$ git push
$ vsce publish

Don't forget to update README.md with details of what is new in the released version...

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

JavaScriptperfmattersperformanceperformance-analysisperformance-visualization

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category数据库
PricingOpen source

> Related tools

P
PostgreSQL
功能强大的开源关系型数据库
R
Redis
内存数据结构存储,常用作缓存与队列
M
MySQL
广泛使用的开源关系型数据库