Skip to content

icecreamliker/grunt-cssnano-plus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

grunt-cssnano-plus

A better cssnano grunt plugin for minifying CSS

Install

$ npm install --save-dev grunt-cssnano-plus

Advantages

  • Support directory dest
  • Support verbose message output

Usage

grunt.initConfig({
  cssnano: {
    options: {
      sourcemap: true
    },
    dist: {
      files: {
        'path/dist/index.min.css': 'path/src/index.css',
        'path/dist/app.min.css': 'path/src/app.css'
      }
    }
  }
});

Or compile all the CSS files into a specific directory:

grunt.initConfig({
  cssnano: {
    options: {
      sourcemap: true
    },
    dist: {
      files: [{
          src: 'path/src/*.css',
          dest: 'path/dist/'
      }]
    }
  }
});

Or customize multi-tasks:

grunt.initConfig({
  cssnano: {
    options: {
      sourcemap: true
    },
    subtask1: {
      files: [{
          src: 'path/src/*.css',
          dest: 'path/dist/'
      }]
    },
    subtask2: {
      files: {
        'path/dist/index.min.css': 'path/src/index.css',
        'path/dist/app.min.css': 'path/src/app.css'
      }
    }
  }
});

Options

See the cssnano options.

License

grunt-cssnano-plus is available under the terms of the MIT license.

About

A better cssnano grunt plugin for minifying CSS

Resources

License

Stars

Watchers

Forks

Packages

No packages published