Angular 8/Sass:查找未使用的CSS类 [英] Angular 8/Sass: Find unused css classes

查看:58
本文介绍了Angular 8/Sass:查找未使用的CSS类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用Angular + Sass的Angular项目,并且由于该项目变得相当大,所以我一直在寻找需要删除的未使用的小型css类.我正在尝试找到一种方法将其全部删除,但目前没有任何帮助.

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.

我尝试了没有提供任何输出或错误的purifycss,ngx-unused-css,因为它存在框架错误(路径必须是未定义的字符串),我无法使其正常工作,我感觉自己出局了选项,以及其中不显示任何css文件的Chrome覆盖范围,并且外部站点也不可选,因为它们将无法访问已部署的项目位置.

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.

是否可以使用某种工具或选项在Angular/Sass中查找所有未使用的类?

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

推荐答案

为此有很多IDE插件.

There are a lot of IDE plugins for that.

在我的情况下,我使用 https://marketplace.visualstudio.com/items?itemName = rcore.rcore-unused-css-classes 来自Visual Studio代码扩展

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

这篇关于Angular 8/Sass:查找未使用的CSS类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆