Skip to main content
AuditJet

JavaScript Performance · AuditJet Glossary

Tree Shaking

A dead code elimination technique used by JavaScript bundlers to remove unused exports from the final bundle.

Tree shaking works by analysing the dependency graph of ES modules and removing any exports that are never imported. It's supported by Webpack, Rollup, and esbuild. Effective tree shaking requires using ES module syntax (import/export) rather than CommonJS. Unused library code is a common cause of bloated JavaScript bundles that inflate TBT and INP.

Frequently asked questions

What is Tree Shaking?

A dead code elimination technique used by JavaScript bundlers to remove unused exports from the final bundle.

How does AuditJet measure Tree Shaking?

AuditJet runs automated Google Lighthouse audits that surface Tree Shaking scores alongside actionable fix guidance. You can track Tree Shaking trends across all your pages and receive alerts when the metric regresses.

Monitor Tree continuously

AuditJet tracks Core Web Vitals on a schedule with revenue impact alerts — powered by Google Lighthouse and Google PageSpeed Insights.

Start Free
Tree Shaking — Definition | AuditJet Glossary | AuditJet