Compressed javascript files are ideal for production environments since they typically reduce the size of the file by 30-90%. Most of the filesize reduction is achieved by removing comments and extra whitespace characters that are not needed by web browsers or visitors.

I just found this plugin for Sublime Text 2:JsMinifier (The plugin minifies JavaScript by using the Google Closure Compiler.)

Manual installation

To install any plug in in Mac OS X version:

Click Sublime Text 2 menu.

Click Preferences, Browse Packages.

Copy the Plugin folder inside Packages folder.

Restart Sublime Text 2

That's it, now you can use command:

[control] + [alt] + m

To minify your js file.

Using Package Control for installation

Another way to install the plugin is via the Package Control of Sublime Text 2 which is an utility to do manage plugins/packages easily.

About the author

Julio Mora is an experienced developer who has worked creating mobile applications for the demanding video game industry. He has experience working with international teams and has earned the respect of his team members for his commitment to delivering excellent work products. He continues to focus on building an exceptional user experience. His background includes: