Glossary term
What is tree-shaking? Meaning for developers
In Scenario Debugging
A build step that removes code nobody imports. It works best when you import single functions from ES modules.
Learn it properly · Scenario DebuggingLesson 6: Slow First Load: Bundles, Code Splitting and LCPBundle analysis, code splitting by route, image optimisation, font loading, preload and preconnect, and Server Components with streaming.In JavaScript Part 2
A bundler step that removes exports nobody uses.
Learn it properly · JavaScript Part 2Lesson 3: Modules: ES Modules, CommonJS, Bundlers and Tree ShakingLive bindings versus copies, Node's module rules, circular imports, and a real bundle built with esbuild.