【问题标题】:Grunt css Purge no output fileGrunt css 清除无输出文件
【发布时间】:2016-05-12 21:08:49
【问题描述】:

我在 gruntfile.js 中写道:

  // Css Purge
  css_purge: {
  options: {
    "verbose": false,
    "no_duplicate_property": true,
  },
  files: {
   src: 'css/bigfile.css',
   dest: 'css/purged.css'
  },
 }

只是为了测试 bigFile.css 是:

body {color: red;}
body, p {color:red;}
p {color: red; font-size: 24px;}
#test p {color: red;}

所以终端消息是:

Running "css_purge:files" (css_purge) task
"css/" has been created

Thu May 12 2016 01:33:27 GMT-0400 (EDT) Success! css/bigfile.css : css/purged.css

但是新文件purged.css和bigFile.css是一样的

【问题讨论】:

  • 您可以发布您的 css 文件吗?
  • 嗨,Louis,我们刚刚更新了 CSS-Purge 的核心,它会满足你的要求:rbtech.github.io/css-purge,你可以同时独立使用它,直到grunt 插件已更新。

标签: node.js npm gruntjs


【解决方案1】:

好吧,想办法。它只删除了相同的规则。因此,如果我有完全相同的规则,它将在输出文件中删除。是否有一个工具可以删除我的示例文件中的额外 css body,p {color:red;} 是额外的代码,因为我已经有了 body {color:red;}

【讨论】:

  • 嗨,Louis,我们刚刚更新了 CSS-Purge 的核心,它会满足你的要求:rbtech.github.io/css-purge,你可以同时独立使用它,直到 grunt 插件更新
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-12-09
  • 2015-10-29
  • 2021-08-15
  • 1970-01-01
  • 1970-01-01
  • 2023-03-27
相关资源
最近更新 更多