Reputation: 14534
I am 100% following the official guide here to build an starter Angular2 and webpack project.
After production build success, I found out the
Those sizes are after uglify and minify.
What else do I need to do to make angular2 app smaller (especially vendor.js)?
I heared about "tree shaking", can you share some samples on how to do it?
Upvotes: 1
Views: 74
Reputation: 12376
If this an Angular CLI app, add AoT to the build:
ng build --prod --aot
You'll get potentially smaller sizes of the files even though at this point AoT seems to be making good impact on smaller apps (your case) and not on the large ones.
As @EternalLight mentioned, use the Web server that can serve pre-created gziped files, e.g. Node Static https://www.npmjs.com/package/node-static. Take a look at the sample package.json here: https://github.com/Farata/angular2typescript/blob/master/chapter10/angular2-webpack-starter/package.json
Upvotes: 1
Reputation: 1328
Surely, Angular 2 is famous for its size. I suggest:
Upvotes: 1