0

我正在尝试让 UnCss 生成我的主 CSS 文件的缩减版本,现在我只想让这个在主页上工作作为测试。

我正在使用以下代码:

uncss: {
  dist: {
    options: {
      stylesheets  : ['localhost/assets/css/master-2014.css'],
      urls         : ['localhost/en-gb/']
    },
    files: {
      'css/app.clean.css': ['localhost/en-gb/']
    }
  }
}

我在这里尝试做的是master-2014.css从我的本地服务器(最终是远程 url,例如 google.com)读取,然后查看我从(我的主页localhost)获得样式表的页面并确定需要哪种样式。我终于想把它制作成app.clean.css.

目前我无法让它为我的生活工作我尝试了其他变体,例如:

    files: {
      'css/app.clean.css': ['**/*.Master', '**/*.ascx']
    }

这不起作用。

我也看到人们尝试这样的事情:

    files: {
      'css/app.clean.css': ['index.html']
    }

index.html空白 html 文件在哪里。这是唯一成功的,但它只是为我创建了一个仅包含 css for htmland的 css 文件body。其余的都抛出以下错误:

Running "uncss:dist" (uncss) task
Warning: Destination (css/app.clean.css) not written because src files were empty. Use --force to continue.

Aborted due to warnings.

我能找到的所有其他示例都是针对 WordPress 的,它是 PHP,这是一个 .Net 站点。

如果有任何帮助,我将不胜感激。

4

0 回答 0