Minimizing Javascript [closed]

The whole idea of minifying the javascript is to remove any and all unnecessary line breaks and white space and in the case of a good minifyers, it will rename variables as well.

The beautifyer ADDS line breaks and white space so as to make things more readable, which means you’re circumventing the whole point of minification by putting your code into the beautifier. Run the beautifier on your non-minified code to make it more readable for you and when you’re ready to publish it to the web, then minify it. Minified javascript is not meant to be readable.

I usually keep a development version and a release version. I test locally and then when I upload my changes, I minify.

Hope this helps.

Leave a Comment