How to run compass compile without file or line reference?

你离开我真会死。 提交于 2019-11-26 16:55:53

问题


How can I suppress file or line reference such as the commented output line below when running compass compile and possibly keep --output-style expanded by default?

/* line 85, ../../../app/stylesheets/simpla/style.sass */
.align-right { 
  float: right;
}

The problem is whenever I make 1 line change in sass, it makes 50+ line changes to my css to update all the reference line numbers that got adjusted. This makes it really hard to read the actual changes in my git commit.


回答1:


Nevermind, just figured it out. In config/compass.rb, set:

line_comments = false

This will suppress/remove the comments from the compiled css files.




回答2:


Just to update previous answer, by Chase T.

For me this is not working anymore.

line_comments = false

should become

line_comments = 0



回答3:


From command-line, try:

compass compile --no-line-comments

If you're using Grunt and grunt-contrib-compass, it's noLineComments: true, e.g.

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');
};

then run: grunt compass.



来源:https://stackoverflow.com/questions/13080662/how-to-run-compass-compile-without-file-or-line-reference

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!