Minify is a simple command-line wrapper that can minify almost anything.
Listed below are the supported filetypes and what's actually used to minify them.
- javascript uglify-js2
- css r.js
- php htmlcompressor
- html htmlcompressor
- png pngcrush
- jpeg jpegtran
Defaults for image compression were inspired by Yahoo
git clone [email protected]:wayneashleyberry/minify.git
cd minify
chmod +x minify.js
npm install .
brew install jpeg-turbo pngcrush
brew link jpeg-turbo
Usage: minify.js [file] [options]
Options:
-h, --help output usage information
-V, --version output the version number
-o, --output [path] specify an output path (optional)
-g, --git-hash prepends the abbreviated git commit hash to the output filename
-c, --content-hash prepends an abbreviated hash based on the minified output
-a, --append [string] append a custom string to the output filename [.min]
-v, --verbose write verbose output
Optimize a single file
./minify.js test/test.css
Optimize all files
./minify.js test/*
Optimize all javascript files, appending content hashes
./minify.js src/**/*.js --content-hash --output dist