This is a quick command line CSS & JS minifier. Designed to be run during the build phase of a web app's deployment. It creates a second version of every .js and .css file (with the extension .min.js and .min.css). It's left up to the dev to decide how to reference these minified versions in production.
It uses the Closure Compilier (by Google) to minify the JavaScript. It uses the CssMin PHP project to minify the css.
- Requires PHP >= 5.4 (earlier versions untested)
- Requires Java (for Closure)
Specify any options and then specify the files or directories that you'd like the minifier to work through.
php minify.php [options] <file1|dir1> [<file2|dir2> [<...>]]
-r
: Recurse through any sub-directories that may be present.
php minify.php -r static/css/ static/js/