How to run compass compile without file or line reference?

后端 未结 3 526
离开以前
离开以前 2020-12-03 16:25

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

相关标签:
3条回答
  • 2020-12-03 16:44

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

    line_comments = false
    

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

    0 讨论(0)
  • 2020-12-03 16:52

    Just to update previous answer, by Chase T.

    For me this is not working anymore.

    line_comments = false
    

    should become

    line_comments = 0
    
    0 讨论(0)
  • 2020-12-03 16:52

    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.

    0 讨论(0)
提交回复
热议问题