This is a super-hacky tool that processes JavaScript bundless before they are fed to Uglify.
Purify adds @__PURE__
annotation in front of all IIFE's that represent ES classes downleveled by TypeScript.
This annotation then enables Uglify 2.8+ to safely recognize if the class is not used and remove it.
You can use it webpack-plugin or cli.
Angular developers will need the bundle to be also processed by alxhub/ngo before the full effect can be seen.
The goal of this tool is to estimate the impact of this optimization. It's not really meant for production use, but primarily for research. That's why I didn't publish it on npm or as a github repo.
The proper solution is going to be implemented via AST transformations rather than unreliable regular expression substitution.
Follow angular/tsickle/#452 and Microsoft/TypeScript#13721.