grunt-contrib-cssmin - how to remove comments from minified css

后端 未结 2 615
深忆病人
深忆病人 2021-02-13 10:35

Im using cssmin to minify css files.

my config like this:

module.exports = function(grunt) {

    grunt.config.set(\'cssmin\', {
        site: {
                 


        
2条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-13 10:55

    Set keepSpecialComments to zero, for removing all comments.

    grunt.config.set('cssmin', {
        options: {
            keepSpecialComments: 0
        },
        site: {
            src: ['.tmp/public/concat/site.css'],
            dest: '.tmp/public/min/site.min.css'
        }
    });
    

    For future reference: grunt-contrib-cssmin uses clean-css options.

提交回复
热议问题