VOOZH about

URL: https://marketplace.visualstudio.com/items?itemName=wix.vscode-import-cost

⇱ Import Cost - Visual Studio Marketplace


Skip to content
👁 Image
Sign in
Visual Studio Code>Other>Import CostNew to Visual Studio Code? Get it now.
👁 Import Cost

Import Cost

Display import/require package size in the editor
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Import Cost VSCode Extension 👁 Build Status

👁 Image
👁 Image

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.

👁 Example Image

Features

Calculates the size of imports and requires. Currently supports:

  • Default importing: import Func from 'utils';
  • Entire content importing: import * as Utils from 'utils';
  • Selective importing: import {Func} from 'utils';
  • Selective importing with alias: import {orig as alias} from 'utils';
  • Submodule importing: import Func from 'utils/Func';
  • Require: const Func = require('utils').Func;
  • Supports both Javascript and Typescript

Why & How

We detail the why and how in this blog post: https://medium.com/@yairhaimo/keep-your-bundle-size-under-control-with-import-cost-vscode-extension-5d476b3c5a76

Known Issues

  • Importing two libraries with a common dependency will show the size of both libraries isolated from each other, even if the common library needs to be imported only once.