ecentinela / minifier

PHP/CLI: Automatic minify all your javascript and stylesheet files with YUICompressor

This URL has Read+Write access

name age message
file README.md Mon Nov 09 03:15:12 -0800 2009 changed documentation's extension [ecentinela]
file minifier.php Fri Oct 09 08:31:10 -0700 2009 shows help when both only_javascripts and only_... [ecentinela]
file minify.php Fri Oct 09 08:30:33 -0700 2009 fixed a typo [ecentinela]
file yuicompressor.jar Fri Oct 09 08:22:52 -0700 2009 initial commit [ecentinela]
README.md

Problem

  • Javascripts and stylesheets are too large because they are not compressed
  • Users & your bandwidth is wasted for useless metadata

Solution

  • file size reduction (10-97% size reduction)
  • combines all files (js+css) from a given folder

Usage

Compress a single javascript or stylesheet file or a whole folder.

Usage:

php minifier.php /public [options]
php minifier.php /stylesheets/common.css [options]

Options are:

-q, --quiet                      no output
-p, --pretend                    no changes are made
-r, --recursive                  execute the action on all subdirectories
-js, --javascripts               compress only javascript files
-css, --stylesheets              compress only stylesheets files
-c, --combine                    combines all files in one

Example

php minifier.php /images
  minifing /public/common.js
  2887 -> 132                              = 4%

  minifing /public/stylesheets/all.css
  3136 -> 282                              = 8%

  minifing /javascripts/carrousel.js
  5045 -> 4                                = 0%
  ...

Author

Javier Martinez Fernandez
ecentinela@gmail.com