I'm trying to remove all CSS comments using Grunt and grunt-contrib-cssmin, the CSS file is compiled and minified it has all comments.
Comments should be removed with the 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'], // which files to watch
tasks: ['less'],
options: {
nospawn: true
}
},
},
cssmin: {
options: {
keepSpecialComments: 0
}
}
});
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.registerTask('default', ['less','cssmin', 'watch']);
};