Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Find ways to reduce the eventual bundle size #1175

Open
NothingEverHappens opened this issue Oct 22, 2019 · 1 comment
Open

Find ways to reduce the eventual bundle size #1175

NothingEverHappens opened this issue Oct 22, 2019 · 1 comment

Comments

@NothingEverHappens
Copy link
Collaborator

NothingEverHappens commented Oct 22, 2019

What the issue is about

image

Codelab historically has a giant bundle (15mb+), big part of it is due to the following things:

  1. We use TypeScript in the browser +7mb
  2. We bundle all the types in a single file (files.txt) + 2.5mb
  3. We bundle everything angular-related (ng2-bundle) + 2.5mb
  4. The editor we're using (monaco) is also giant.
  5. 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
@antkiewicz
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants