Updated to work with current webpack (4.x) and UglifyJS
Your example was really helpful as I worked through packaging a typescript component (thanks!), but I found a handful of details that no longer worked as illustrated in the example. I can't say with confidence that the attached is optimal, but it seems to produce the desired result, and I think is functionally equivalent to the original (but in a way that works with current versions of things).
@jrheling I just stopped by to say thank you for this pull request, it saved me a lot of time. The fact this otherwise excellent article is outdated is hard to spot unless you look at a comment section (lack of publication dates alongside article titles doesn't help either) and it's particularly problematic because it still ranks high in Google search.