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

后端 未结 2 614
深忆病人
深忆病人 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 11:01

    It's an old question but now you can use it like this:

    module.exports = function(grunt) {
      grunt.config.set('cssmin', {
        options: {
          level: {
            1: {
              specialComments: 0
            }
          }
        },
        site: {
          src: ['.tmp/public/concat/site.css'],
          dest: '.tmp/public/min/site.min.css'
        }
      });
      grunt.loadNpmTasks('grunt-contrib-cssmin');
    };
    

    clean-css #How to apply level 1 & 2 optimizations at the same time?

提交回复
热议问题