指南针:如何从生成的CSS文件中删除包含软件包SCS路径的注释? [英] Compass: how to remove comments containing path to a package scss from generated css file?

查看:105
本文介绍了指南针:如何从生成的CSS文件中删除包含软件包SCS路径的注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在项目中使用指南针。它会生成一些css文件,在我同事的机器上看起来像这样:

We use compass in our project. It generates some css files, which look like this on my colleague's machine:

/* line 22, ../../../../.rvm/gems/ruby-1.9.3-p125/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
html {
  line-height: 1; }

/* line 24, ../../../../.rvm/gems/ruby-1.9.3-p125/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
ol, ul {
  list-style: none; }

/* line 10, ../sass/partials/dependencies/font-awesome/_larger.scss */
.fa-2x {
  font-size: 2em; }

但是有时候我必须自己更新CSS。我编辑相应的sass文件并运行 compass compile 。它可以成功地重新生成CSS,但是注释的一半已更改:

But sometimes I have to update CSS by myself. I edit the corresponding sass file and run compass compile. It regenerates CSS successfully, but half of comments are changed:

/* line 22, C:/Soft/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
html {
  line-height: 1; }

/* line 24, C:/Soft/Ruby193/lib/ruby/gems/1.9.1/gems/compass-0.12.2/frameworks/compass/stylesheets/compass/reset/_utilities.scss */
ol, ul {
  list-style: none; }

/* line 10, ../sass/partials/dependencies/font-awesome/_larger.scss */
.fa-2x {
  font-size: 2em; }

这是问题所在:我们将此CSS存储在VCS中,因为我们团队中的每个人都没有Ruby并安装指南针。并且,每次在SASS中修改一行的提交都会扩展为一千行的提交,从而更改注释(因为我们在不同目录中安装了指南针)。

Here's the problem: we store this CSS in a VCS, as not everyone in our team has Ruby and Compass installed. And each commit modifying one line in SASS expands to a thousand-line commit which changes comments (because we have compass installed in different directories).

有什么方法可以防止指南添加有关框架的评论?我想保留有关该项目的SCSS的评论,但我想摆脱来自位于特定于机器的位置的框架的评论。

Is there any way to prevent compass from adding comments about frameworks? I want to keep comments about SCSS coming from the project, but I want to get rid of comments that come from frameworks lying in a machine-specific place.

推荐答案

这可以在config.rb中进行更改

This can be changed in config.rb

line_comments = false

这篇关于指南针:如何从生成的CSS文件中删除包含软件包SCS路径的注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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