Tree shaking
In computing, tree shaking is a dead code elimination technique that is applied when bundling code with its dependencies.[src] It is most commonly applied to dynamic languages, in practice most commonly JavaScript/ECMAScript.[src] Often contrasted with traditional single-library dead code elimination techniques common to minifiers, tree shaking eliminates unused functions from across the bundle by starting at the entry point and only including functions that may be executed.[src] It is succinctly described as "live code inclusion".[src] In less-dynamic languages such as C, ordinary dead-code elimination becomes equivalent to tree-shaking with whole program optimization, which also uses knowledge of entry points.[src]
In computing, tree shaking is a dead code elimination technique that is applied when bundling code with its dependencies.[src] It is most commonly applied to dynamic languages, in practice most commonly JavaScript/ECMAScript.[src] Often contrasted with traditional single-library dead code elimination techniques common to minifiers, tree shaking eliminates unused functions from across the bundle by starting at the entry point and only including functions that may be executed.[src] It is succinctly described as "live code inclusion".[src] In less-dynamic languages such as C, ordinary dead-code elimination becomes equivalent to tree-shaking with whole program optimization, which also uses knowledge of entry points.[src]
10 sentences · 10 cited inline · 0 references stored
References
No reference rows published for this article.
Cite this article
MLA
"Tree shaking." encyclopegia.org, 2026, https://encyclopegia.org/wiki/tree-shaking. Accessed 26 November 2026.
Chicago
"Tree shaking." encyclopegia.org. Accessed November 26, 2026. https://encyclopegia.org/wiki/tree-shaking.
APA
encyclopegia.org. (2026). Tree shaking. Retrieved November 26, 2026, from https://encyclopegia.org/wiki/tree-shaking
Accessed November 26, 2026 · CC BY-SA 4.0 · citation page · JSON