How to use tree-shaking with webpack 2 and typescript and angular 2? -
i have set webpack 2 angular , seems work. not seem though tree-shaking
, since have app nothing, , vendor.js
still 800+ kb.
it seems there little information available on how turn tree-shaking on, understood it's automatically turned on es6 modules, not work es5. so?
and importantly: how can apply tree-shaking typescript/angular2 webpack2?
i have found nice repository examples on how this.
as mentioned in there , in comments question, there apparently bugs prevent tree-shaking happening. seems mean it's not possible "target": "es5"
.
we can use es2015
, we'll need additional steps (e.g. via babel) compile es5
until browsers support it.
Comments
Post a Comment