Can angular-cli remove unused css?

后端 未结 6 1489
时光说笑
时光说笑 2020-12-23 21:22

so far the smallest bundle I can create with angular cli is by running

ng build --aot true -prod

I was wondering if the build p

6条回答
  •  被撕碎了的回忆
    2020-12-23 22:08

    In Angular the best option you have is to create a separate CSS file for each component and use ViewEncapsulated.Emulated.

    And in this file you will add just CSS used by this component. You can discover styles used by each page with "coverge" from Google Chrome

提交回复
热议问题