I suspect (although I haven't checked the code) that this is actually a "dead code elimination" algorithm which is easier to write than a tree shaking algorithm.<p>Tree-shaking is actually "live code inclusion", the opposite side of dead code elimination.<p><a href="https://en.m.wikipedia.org/wiki/Tree_shaking" rel="nofollow">https://en.m.wikipedia.org/wiki/Tree_shaking</a>