views:

25

answers:

1

hi...

im looking for a JS minifier... i dont need obfuscation... the project has over 100 js files, arranged into a directory hierarchy.

i've googled around but couldnt find anything useful. i tried Dean Edwards JavaScript's Packer but got errors in the minified script.

my requirement is simple.. i need a software to minify all these js files .

how about css files?

A: 

We have a bunch of .js files and .css in our app too.
We wrote a shell script that runs on the server that launch the YUI Compressor.

  1. A file contains all the references to the js and css to minify
  2. The script loops on these files and execute YUI Compressor on each
  3. The minified file is added. ie: mobile.js --> mobile_min.js

For the HTML we added some regexp replacements lines in the scripts to minify them too.

All this is part of a higher script that we use to deploy the app to the server in a single step.

Although it may sound difficult, the shell script are something easily manageable and worth learning.

Mic
yeah.. it makes sense... but i was thinking that there might be some app which is intelligent enough to do all such things coz its a pretty common requirement
Ahmad