从命令行,尝试:
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
。