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(build): added postcss-discard-comments #2593

Closed
wants to merge 2 commits into from

Conversation

grizzm0
Copy link
Contributor

@grizzm0 grizzm0 commented Oct 8, 2016

Not sure if this is something that will be accepted or if we should wait for #1656.

I've got a single @import "~material-design-lite/src/material-design-lite"; in my ./src/style.scss which results in 31 copies of each comment used in ~material-design-lite/src/variables aswell as a lot of other comments.

Simply removing all CSS comments makes a huge difference in final bundle size as seen below.

Before

                                   Asset       Size  Chunks             Chunk Names
     main.6fbac24ca5132af329fe.bundle.js    1.22 MB    0, 2  [emitted]  main
   styles.b90aa540ebff7287c650.bundle.js     355 kB    1, 2  [emitted]  styles
                               inline.js    1.39 kB       2  [emitted]  inline
styles.b90aa540ebff7287c650.bundle.js.gz    31.7 kB          [emitted]  
  main.6fbac24ca5132af329fe.bundle.js.gz     283 kB          [emitted]  
                              index.html  977 bytes          [emitted]  

After

                                   Asset       Size  Chunks             Chunk Names
     main.8d1026f789bf4650316e.bundle.js    1.22 MB    0, 2  [emitted]  main
   styles.149e785c053377a80361.bundle.js     161 kB    1, 2  [emitted]  styles
                               inline.js    1.39 kB       2  [emitted]  inline
styles.149e785c053377a80361.bundle.js.gz    22.8 kB          [emitted]  
  main.8d1026f789bf4650316e.bundle.js.gz     282 kB          [emitted]  
                              index.html  977 bytes          [emitted]  

@filipesilva
Copy link
Contributor

I agree that it should go in, that is a huge size difference.

JJayet pushed a commit to JJayet/angular-cli that referenced this pull request Oct 14, 2016
Brocco pushed a commit that referenced this pull request Oct 19, 2016
texel pushed a commit to splice/angular-cli that referenced this pull request Nov 3, 2016
@grizzm0 grizzm0 deleted the postcss-discard-comments branch June 10, 2017 11:34
@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 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants