metalsmith-clean-css
A Metalsmith plugin to minify CSS files using clean-css.
Installation
$ npm install metalsmith-clean-css
Usage
CLI
{
"plugins": {
"metalsmith-clean-css": {
"files": "src/**/*.css"
}
}
}
JavaScript
var MetalSmith = require('metalsmith');
var cleanCSS = require('metalsmith-clean-css');
Metalsmith(__dirname)
.use(cleanCSS({
files: 'src/**/*.css',
cleanCSS: {
rebase: true
}
}))
.build()
;
files
Type: String
Default: **/*.css
This option defines which files are concerned by the minification. This string is directly passed to minimatch. Each file matching the pattern will be minified in place using Clean-css.
cleanCSS
Type: Object
Default: {}
Allow you to directly manipulate the Clean-css API. The configuration object will be passed as is.
Changelog
-
2.0.0
- Update Clean-css
-
1.0.0
- Bump stable
-
0.0.3
- Fix an issue with file content
-
0.0.2
- Fix the example
-
0.0.1
- Working plugin
License
MIT © Aymeric Beaumet