Mischiefblog
I make apps for other people

HOWTO minify JavaScript

Posted by Chris Jones
On July 25th, 2012 at 13:32

Permalink | Trackback | Links In |

Comments Off on HOWTO minify JavaScript
Posted in General
  1. Get a copy of jsmin.c from http://crockford.com/javascript/jsmin
  2. Compile jsmin with
    gcc -o jsmin jsmin.c
  3. Put jsmin in your path (i.e., under ~/bin)
  4. Minify JavaScript
  5. jsmin < input.js > output.min.js

As a best practice, when modifying third-party code rename your JavaScript file to something like filename.domain.min.js.

Comments are closed.