How to use tree-shaking with webpack 2 and typescript and angular 2?

风格不统一 提交于 2019-12-03 00:20:56

I have found this very nice repository with examples on how to do this.

As mentioned in there and in the comments to the question, there are apparently bugs that prevent the tree-shaking from happening. That seems to mean it's not really possible to do now with "target": "es5".

We can use es2015, but then we'll need some additional steps (e.g. via Babel) to compile to es5 until browsers support it.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!