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

feat(@ngtools/webpack): show warning when large CSS are included in c… #15093

Closed
wants to merge 1 commit into from
Closed

feat(@ngtools/webpack): show warning when large CSS are included in c… #15093

wants to merge 1 commit into from

Conversation

alan-agius4
Copy link
Collaborator

…omponents

It’s very easy to inadvertently import toplevel css in component styles. Since component css is standalone and self-contained, it will never be shared between components and remains as a single large bundle for each component. This in turn adds a large amount of code that must be processed and increases bundle size.

Related to: TOOL-949

@alan-agius4 alan-agius4 added state: WIP needs: discussion On the agenda for team meeting to determine next steps PR state: blocked labels Jul 16, 2019
@alan-agius4
Copy link
Collaborator Author

  1. When the stylesUrl is an array should be sum of the total size of the styles or still check each file individually?
  2. What should be the size limit?
  3. Between dev and prod build the the size might varies quite a bit because of minifications and inline sourcemaps, how should be tackle this?

…omponents

It’s very easy to inadvertently import toplevel css in component styles. Since component css is standalone and self-contained, it will never be shared between components and remains as a single large bundle for each component. This in turn adds a large amount of code that must be processed and increases bundle size.

Related to: TOOL-949
@filipesilva
Copy link
Contributor

I think the answers are:

  1. individual css, because the problem is usually one inadvertently very large piece of css instead of several average sized ones
  2. I don't know. Maybe 20kb? Perhaps we should roll this into the bundle budgets feature, and use a default there that users can change.
  3. We should use a similar logic as bundle budgets so that the reasoning is familiar.

@alan-agius4
Copy link
Collaborator Author

As suggested by yourself, let's try to use bundle budgets for this

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants