codelab
codelab copied to clipboard
Find ways to reduce the eventual bundle size
What the issue is about

Codelab historically has a giant bundle (15mb+), big part of it is due to the following things:
- We use TypeScript in the browser +7mb
- We bundle all the types in a single file (files.txt) + 2.5mb
- We bundle everything angular-related (ng2-bundle) + 2.5mb
- The editor we're using (monaco) is also giant.
- Everything else adds up to many mode mb
The goal of this tasks is to use webpack bundle analizer and `source-map-analizer' to find how to reduce the size of the bundle to make things load faster.
Where to start
There are many ways to go around this, a good start would be:
ng build --prod --stats-json
npx webpack-bundle-analyzer ./dist/apps/codelab/stats-es2015.json
I've noticed we are loading CodelabComponentsModule, which also includes monaco in IndexModule. Since our milestone modules also import it, shouldn't we skip loading it on index page? We have no use for those components or monaco there anyway. This would make initial homepage load a bit faster.