问题
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; }
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; }
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).
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.
回答1:
This can be changed in config.rb
line_comments = false
回答2:
I added
line_comments = false
to my config/compass.rb to remove all of the line comments from the compiled stylesheets.
来源:https://stackoverflow.com/questions/20161219/compass-how-to-remove-comments-containing-path-to-a-package-scss-from-generated