Angular 8/Sass: Find unused css classes

こ雲淡風輕ζ 提交于 2020-05-14 05:28:10

问题


I have an Angular project that uses Angular+Sass, and since the project became pretty big I am constantly finding unused small css classes that need to be removed. I am trying to find a way to remove them all, but for now nothing helped me.

I tried purifycss that didn't give me any output or error, ngx-unused-css that I cannot make it work since it has a framework error (path must be string not undefined), and I feel like I am out of options, and the coverage of Chrome that doesn't display any css files in it, and external sites are not an option since they won't have access to the deployed project location.

Is there some kind of tool or option that I can use to find all unused classes in Angular/Sass?


回答1:


There are a lot of IDE plugins for that.

On my case I use https://marketplace.visualstudio.com/items?itemName=rcore.rcore-unused-css-classes from Visual Studio Code Extensions



来源:https://stackoverflow.com/questions/58878222/angular-8-sass-find-unused-css-classes

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!