treeshake-cli is a command-line tool that analyzes JavaScript bundles to determine how effectively Rollup, Webpack, and ESBuild tree-shake unused code. Version 0.2.6 is stable with monthly releases. It provides a unified interface to run multiple bundlers on the same input and compare outputs, highlighting dead code elimination differences. Unlike manual bundler configuration, it offers an out-of-the-box comparison with clear metrics.
npm install treeshake-cliNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Analyzes bundle.js for tree-shaking efficiency using Rollup, Webpack, and ESBuild.
Update Node.js to 12+ or use npx which manages version automatically.
Convert CommonJS to ESM or use a different tool for CJS analysis.
Ensure input is a bundled output (not raw source code).
Install rollup: npm install rollup -D
Provide a .js or .mjs file that is an ES module bundle.
Ensure the input bundle is an ES module (use import/export) or transpile to ESM.