As a curiosity, and I say this as someone who has a significant C background, what would you call a similar concept in C? I know that it happens (having been burned by missing symbol errors due to incorrect link ordering), but I don't actually know what it's called.
Typically it would be called dead-code elimination. The creator of rollup who popularized the term tree-shaking disagrees that they are the same, but his argument is not super compelling (not that it really matters either way).