如何在没有文件或行引用的情况下运行罗盘编译?
如何在运行compass compile
时抑制文件或行引用(例如下面注释的输出行),并且可能保持--output-style
默认扩展?
/* line 85, ../../../app/stylesheets/simpla/style.sass */ .align-right { float: right; }
问题是每当我在sass中进行1行更改时,它会对我的css进行50多行更改以更新所有已调整的参考行号。 这使我很难阅读我的git提交中的实际更改。
没关系,只是搞清楚了。 在config / compass.rb中,设置:
line_comments = false
这将抑制/删除已编译的css文件中的注释。
只是为了更新以前的答案,由Chase T.
对我来说这不再适用了。
line_comments = false
应该成为
line_comments = 0
从命令行,尝试:
compass compile --no-line-comments
如果你正在使用Grunt和grunt-contrib-compass ,那就是noLineComments: true
,例如
module.exports = function (grunt) { grunt.initConfig({ watch: { src: { files: ['**/*.scss', '**/*.php'], tasks: ['compass:dev'] }, options: { livereload: true } }, compass: { dev: { options: { sassDir: 'sass', cssDir: 'css', imagesPath: 'img', noLineComments: true, outputStyle: 'compressed' } } } }); grunt.loadNpmTasks('grunt-contrib-compass'); grunt.loadNpmTasks('grunt-contrib-sass'); grunt.loadNpmTasks('grunt-contrib-watch'); };
然后跑: grunt compass
。