21个实用的JavaScript压缩工具

jopen 10年前

在线工具

21. UglifyJS

UglifyJS is a JavaScript compressor/minifier written in JavaScript

20. Microsoft Ajax Minifier

The Microsoft Ajax Minifier enables you to improve the performance of your web applications by reducing the size of your Cascading Style Sheet and JavaScript files.

19. YUI Compressor

It is an amazing YUI compressor widely used tools to minify Javascript code.

18. Dojo ShrinkSafe 

ShrinkSafe is a JavaScript “compression” system. It can typically reduce the size of your scripts by a third or more, depending on your programming style.

17.  Dean Edwards’ Packer

It is another tool for remove and optimize your code.

16. Douglas Crockford’s JSMin 

JSMin is a filter that removes comments and unnecessary whitespace from
JavaScript files.

15. Closure Compiler

A JavaScript checker and optimizer

14. javascript-minifier.com

This tool looks fairly nice and has a good API.

13. Online YUI Compressor

This tool utilizes the use of YUI compressor and offers more power. It also has CSS minification capabilities and loads of other options to play around with.

12. jscompress.com

This is not a very fancy tool, but does the job you are looking for fairly nicely.

11. jsmini.com

One of the more simpler tools you could come across but delivers the result nonetheless.

GUI 工具

10. Koala

This is a free tool for minification of JavaSript. You can also use it for compilation of LESS and SASS. It offers a lot more than just these primary functions.

9. Prepros

This is a paid app, which offers the basic minification functionality along with a lot more. The fact that it is a paid app means you will be offered a host of different features which you may not be able to find for free.

8. Codekit

This particular application is paid. Another catch is that it is for a Mac only. It can compile code for you, minify JavaScript, and has a preview server. There are tons of other goodies for you to explore and use.

7. AjaxminGui

This is a free tool which you can use on Windows for minifying JavaScript. Know that minification is all that it offers but as long as you are looking for only minification, I guess we are all set.

6. UltraMinifier

This particular application is free and works with OS X. it minifies CSS and JavaScript both. All you need to do is drag and drop.

5. Smaller

This is another OS X tool which minifies files for you.

命令行工具

4. Minify

If you are looking to only minify JavaScript from the command line without having to set up anything fancy in Gulp or Grunt, you can use this tool.

3. Uglify.js

True to its name, the beautiful code of JavaScript is turned very ugly upon application of this tool. The compression is amazing.

2. Grunt

While the primary functionality of this tool is not JavaScript minification, it does offer an extension to achieve that result which can be found here.

1. Gulp

Finally, we have Gulp which allows for JavaScript minification using this.