I am currently in the process of eliminating all CSS comments by utilizing Grunt and grunt-contrib-cssmin. The CSS file has been compiled and minified, but still contains comments.
To remove these comments, I need to use the following line: keepSpecialComments: 0
module.exports = function(grunt) {
require('jit-grunt')(grunt);
grunt.initConfig({
less: {
development: {
options: {
compress: true,
yuicompress: true,
optimization: 2
},
files: {
"css/main.css": "less/bootstrap.less" // destination file and source file
}
}
},
watch: {
styles: {
files: ['less/**/*.less'], // specify which files to monitor
tasks: ['less'],
options: {
nospawn: true
}
},
},
cssmin: {
options: {
keepSpecialComments: 0
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['less','cssmin', 'watch']);
};