mincss
v0.4.1
Published
Minify CSS with Source Map support
Downloads
17
Maintainers
Readme
MinCSS
Minify CSS with Source Map support.
Forked from CSSWring. Written with PostCSS.
INSTALLATION
$ npm install mincss
QUICK USAGE
var fs = require('fs');
var mincss = require('mincss');
var css = fs.readFileSync('styles.css', 'utf8');
fs.writeFileSync('styles.min.css', mincss.minify(css).css);
You can pass options as second parameter to mincss.minify()
. To preserve
"doc block" style comments (/*! ... */
), set preserveComments
option to
true
. Likewise, to preserve some CSS hacks, set preserveHacks
option.
CLI USAGE
This modules also includes a command line interface.
$ mincss --help
Usage:
mincss [options] [INPUT] [OUTPUT]
Description:
Minify CSS with Source Map support.
Options:
--sourcemap Create source map file.
--preserve-comments Preserve "doc block" comments.
--preserve-hacks Preserve some CSS hacks.
-h, --help Show this message.
-v, --version Print version information.
LICENSE
MIT