Tree shaking is insane to me too. Just use a language that can actually do proper DCE, if you're not building a website.
(I do realize though that most "apps" are just websites without the browser toolbar, unfortunately)