Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css grunt UNCS创建重复选择器_Css_Node.js_Angularjs_Gruntjs - Fatal编程技术网

Css grunt UNCS创建重复选择器

Css grunt UNCS创建重复选择器,css,node.js,angularjs,gruntjs,Css,Node.js,Angularjs,Gruntjs,我正在使用grunt uncss清理我正在处理的bootstrap/angularjs项目中的css选择器。我使用URL选项是因为我需要UNCS在运行时解析css,因为它是一个角度应用程序。我还使用了文件选项,因为没有它我无法让UNCS工作。这在我的css中导致了一些重复。以下是我的配置: uncss: { dist: { options: { urls: ['http://127.0.0.1:8282/build/index.html#/dashboard',

我正在使用grunt uncss清理我正在处理的bootstrap/angularjs项目中的css选择器。我使用URL选项是因为我需要UNCS在运行时解析css,因为它是一个角度应用程序。我还使用了文件选项,因为没有它我无法让UNCS工作。这在我的css中导致了一些重复。以下是我的配置:

uncss: {
  dist: {
    options: {
        urls: ['http://127.0.0.1:8282/build/index.html#/dashboard', 
               'http://127.0.0.1:8282/build/index.html#/servicedesk', 
               'http://127.0.0.1:8282/build/index.html#/email', 
               'http://127.0.0.1:8282/build/index.html#/calendar', 
               'http://127.0.0.1:8282/build/index.html#/customers']
    },
    files: {
      'build/css/raw/tidy.css': ['build/index.html']
    }
  }
}
index.html有两个css文件,site.css(包含我的所有特定于应用程序的选择器和类)和bootstrap.css

当uncss运行时,它会复制许多选择器。例如,在site.css中正好有一个

servicedesk {
  display: flex;
  width: 100%;
  height: 100%;
  flex-flow: column nowrap;
  justify-content: flex-start;
  align-items: flex-start;
  align-content: flex-start;
  flex: 1;
  margin: auto;
  padding: 1em;
}

在它运行之后,有2个。我不确定为什么会发生这种情况,但我认为这是因为它处理两次,一次在运行时,一次使用静态文件。不确定如何修复发现的未解决问题,并在经过大量搜索后在此处解决: