ivanblazevic/ngx-unused-css

What About the other CSS written in other folders?

alokkarma opened this issue · 3 comments

It is not bug I want to know more about it.
Will it check for the CSS and SCSS file which is included in angular.json file or in style.scss file. If I import CSS or scss file in styles.scss will it remove unnecessary css from there also ? Also if I added SCSS or CSS file in Assets folder .
Your response would be highly appreciable.

Hi, thanks for the interest! At the moment this library only checks template files and their styling files, for example app.component.html > app.component.scss, if styling file is not found then it will skip it. Also, if there is @import inside app.component.scss then this import will be processed as well. Styling files defined inside angular.json or imports defined inside styles.scss are not processed at the moment, this is still feature that needs to be developed - I'll leave this issue open until that feature is not available.

So glad I saw this issue, thanks. For component stylesheets, you shouldn't have enough css that you can't simply clear it up by hand. Something like this would shine in cleaning up third parties clutter and structural global styles.

Global styles analysis is implemented now, you can check how to configure it on the example project
https://github.com/ivanblazevic/ngx-unused-css/tree/master/examples/simpleAngularApp

P.S. Sorry for such a long reply on this topic :/