A better cssnano grunt plugin for minifying CSS
$ npm install --save-dev grunt-cssnano-plus
- Support directory dest
- Support verbose message output
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'
}
}
}
});
See the cssnano
options.
grunt-cssnano-plus is available under the terms of the MIT license.