Skip to content

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

Notifications You must be signed in to change notification settings

ecentinela/minifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
[email protected]

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages