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

export-size

> 开发工具
Open source

Analysis bundle cost for each export of a package

196 stars0 likes1 views
WebsiteGitHub

About

Analysis bundle cost for each export of a package

export-size

Analysis bundle cost for each export of an ESM package

Install

bash
npx export-size [package-name]

Usage

Calculate local package

bash
npx export-size .

Calculate npm package

bash
npx export-size @vueuse/core

More options

bash
npx export-size --help

CLI options

Option Description Default
--install, -i Extra dependencies to install alongside the package []
--external, -x Packages to mark as external (excluded from the bundle) []
--output, -o Emit the bundled and minified files to export-size-output/ false
--report, -r Write a JSON report false
--output-file Path for the JSON report (implies --report) ./export-size-report.json
--bundler, -b Bundler to use, one of esbuild, rollup, rolldown esbuild

Bundlers

export-size supports multiple bundlers under the hood to measure each export's cost:

  • esbuild (default) — fastest, minifies with esbuild's built-in minifier
  • rollup — bundles with Rollup and minifies with terser
  • rolldown — bundles and minifies with Rolldown
bash
npx export-size @vueuse/core --bundler rollup
npx export-size @vueuse/core --bundler rolldown

Programmatic Usage

bash
npm i -D export-size
…

You can also pass a custom bundler instance instead of a bundler name, by extending the abstract Bundler class exported from export-size:

typescript
import { Bundler, getExportsSize } from 'export-size'

class MyBundler extends Bundler {
  async start() { /* ... */ }
  async stop() { /* ... */ }
  async bundle(exportName: string, exportPath: string) {
    return { bundled: '...', minified: '...' }
  }
}

await getExportsSize({
  pkg: '@vueuse/core',
  bundler: new MyBundler(dir, external),
})

Example output

…

TODO

  • Support JSON output
  • Support custom output path

Sponsors

This project is part of my Sponsor Program

License

MIT

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

TypeScriptbundle-sizecliesm

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 18, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具