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.
Tree-shaking is actually "live code inclusion", the opposite side of dead code elimination.
Comments
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.
Tree-shaking is actually "live code inclusion", the opposite side of dead code elimination.
https://en.m.wikipedia.org/wiki/Tree_shaking
"opposite" is not the right term... tree-shaking appears to be a particular technique for dead code elimination.
I.e., there are many algorithms you could use to eliminate dead code, and tree-shaking seems to just be a simple one that works well for JS.
Might be worth checking the code but
Is what this code (tries to!) do