Open SamVerschueren opened 7 years ago
webpack 2 does tree shaking by the way
Thanks for letting me know. I want to create examples for webpack as well because (a) I never used it and (b) it would be nice to have it as a reference.
it's not that hard to learn now that they have the new docs: http://webpack.js.org/ if you need help, ask me :)
maybe this? they implemented tree shaking using gulp-rollup https://github.com/jvandemo/generator-angular2-library
Treeshaking is not the real problem here, the problem is lazy loading in combination with tree shaking which is a much harder nut to crack and is not possible with Rollup because it does not offer code splitting which is used for lazy loading.
Currently, the outpunt bundles uses JiT compilation and doesnt have treeshaking. This means the main bundle is still more tham 1.5 MB in size and nowhere near to 40 kB.
Not sure how to do this properly. Can we use Rollup for this (which doesn't support code splitting) or should we have a look to something like Google Closure Compiler?