推荐15个最好用的JavaScript代码压缩工具

 更新时间:2019年02月13日 10:02:32   作者:梦想天空(山边小溪)  
今天小编就为大家分享一篇关于推荐15个最好用的JavaScript代码压缩工具,小编觉得内容挺不错的,现在分享给大家,具有很好的参考价值,需要的朋友一起跟随小编来看看吧

JavaScript 代码压缩是指去除源代码里的所有不必要的字符,而不改变其功能的过程。这些不必要的字符通常包括空格字符,换行字符,注释以及块分隔符等用来增加可读性的代码,但并不需要它来执行。

在这篇文章中,我们选择了15个最好用的 JavaScript 压缩工具,有简单的在线转换器,GUI工具和命令行界面等。

1. JavaScript Minifier

It is a nice looking tool with an API to minify your js code.

2. JSMIni

If you want to minify your JavaScript or jQuery files quickly and easily, turn to jsMini. Just copy and paste your source code, select whether you want basic or full compression, and then minify your code.

3. JSCompress

JSCompress.com is an online javascript compressor that allows you to compress and minify your javascript files. 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.

4. Minifier

A simple tool for minifying CSS/JS without a big setup. It reworks URLs in CSS from the original location to the output location. It automatically resolves @import statements in CSS.

5. Gulp.js

Gulp.js is the streaming build system. It's use of streams and code-over-configuration makes for a simpler and more intuitive build. By preferring code over configuration, gulp keeps simple things simple and makes complex tasks manageable. By harnassing the power of node's streams you get fast builds that don't write intermediary files to disk. Gulp's strict plugin guidelines assure plugins stay simple and work the way you expect.

6. Uglifyjs

This package implements a general-purpose JavaScript parser/compressor/beautifier toolkit. It is developed on NodeJS, but it should work on any JavaScript platform supporting the CommonJS module system (and if your platform of choice doesn't support CommonJS, you can easily implement it, or discard the exports.* lines from UglifyJS sources).

7. Grunt

Grunt is a task-based command line build tool for JavaScript projects. It has the following predefined tasks that you can use in your project: Concatenate files, Validate files with JSHint, Minify files with UglifyJS, Run unit tests with node unit and etc.

8. Koala

Koala is a GUI application for Less, Sass, Compass and CoffeeScript compilation, to help web developers to use them more efficiently. Koala can run in windows, linux and mac.

9. Prepros

Prepros is a tool to compile LESS, Sass, Compass, Stylus, Jade and much more with automatic CSS prefixing, It comes with built in server for cross browser testing. It runs on windows, mac and linux.

10. Ajax Minifier

This tool is a Windows application that allows you to run the Microsoft Ajax Minifier without using the command line or Visual Studio. It minifies all javascript files in a folder and nested folders, minify individual javascript files, enable/disable the minifier's hypercrunch and analysis options and many more.

11. Smaller

Smaller is a powerful HTML, CSS and JavaScript compressor on OS X which also has the ability to combine several files into one. Compress your files and make your websites load faster.

12. Ultra Minifier

Ultra Minifier is the most simple YUI Compressor GUI to minify Javascript and CSS code without using the Terminal.

13. Require JS

RequireJS is a JavaScript file and module loader. It is optimized for in-browser use, but it can be used in other JavaScript environments, like Rhino and Node. Using a modular script loader like RequireJS will improve the speed and quality of your code. It includes an optimization tool you can run as part of your packaging steps for deploying your code. The optimization tool can combine and minify your JavaScript files to allow for better performance.

14. Online JavaScript/CSS Compressor

This is a web interface to compress your JavaScript or CSS. This tool uses UglifyJS 2, Clean-CSS and HTML Minifier.

15. Minify

Minify is a PHP5 app that helps you follow several of Yahoo!'s Rules for High Performance Web Sites. It combines multiple CSS or Javascript files, removes unnecessary whitespace and comments, and serves them with gzip encoding and optimal client-side cache headers.

总结

以上就是这篇文章的全部内容了,希望本文的内容对大家的学习或者工作具有一定的参考学习价值,谢谢大家对脚本之家的支持。如果你想了解更多相关内容请查看下面相关链接

相关文章

  • 20行代码实现的一个CSS覆盖率测试脚本

    20行代码实现的一个CSS覆盖率测试脚本

    这里我们只求CSS规则的覆盖率,所以访问 querySelectorAll().length 即可。通过排序就可看出各个CSS使用情况
    2013-07-07
  • javascript 动态生成css代码的两种方法

    javascript 动态生成css代码的两种方法

    这篇文章主要介绍了javascript 动态生成css代码的两种方法,有时候我们需要利用js来动态生成页面上style标签中的css代码,下面就给大家介绍两种方法,需要的朋友可以参考下
    2017-03-03
  • 基于BootStrap Metronic开发框架经验小结【一】框架总览及菜单模块的处理

    基于BootStrap Metronic开发框架经验小结【一】框架总览及菜单模块的处理

    这篇文章主要介绍了基于BootStrap Metronic开发框架经验小结【一】框架总览及菜单模块的处理的相关资料,小编认为非常具有参考借鉴价值,感兴趣的朋友一起学习吧
    2016-05-05
  • 移动端H5页面返回并刷新页面(BFcache)的方法

    移动端H5页面返回并刷新页面(BFcache)的方法

    这篇文章主要给大家介绍了关于移动端H5页面返回并刷新页面(BFcache)的相关资料,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2018-11-11
  • JavaScript中随机数方法 Math.random()

    JavaScript中随机数方法 Math.random()

    这篇文章主要介绍了JavaScript中随机数方法 Math.random(),文章围绕主题展开详细的内容介绍,具有一定的参考价值,需要的小伙伴可以参考一下
    2022-06-06
  • js常用代码段收集

    js常用代码段收集

    以下是平时收集的几个常用代码段,大多数是从网上搜集而来。也均为未找到是谁谁原创,是否允许转载等要求, 所以如果看到的朋友发现其中有些代码是自己写的,还请原谅在下转帖出来。
    2011-10-10
  • js 数组的for循环到底应该怎么写?

    js 数组的for循环到底应该怎么写?

    说实话,我是个比较喜欢怀疑权威的人,但是在有些权威的问题一直在我面前闪,闪啊闪,我就开始不怀疑他们了,因为有10000个人说这个东西是对的,我就会觉得它的确是对的吧。
    2010-05-05
  • Echats图表大屏自适应的实现方法

    Echats图表大屏自适应的实现方法

    很多时候我们需要用图表来制作我们统计的数据直观的分析,所以我们可以用Echarts来制作图表,这篇文章主要给大家介绍了关于Echats图表大屏自适应的实现方法,需要的朋友可以参考下
    2021-10-10
  • JavaScript+html5 canvas实现图片破碎重组动画特效

    JavaScript+html5 canvas实现图片破碎重组动画特效

    这篇文章主要介绍了JavaScript+html5 canvas实现破碎重组的视频特效,感兴趣的小伙伴们可以参考一下
    2016-02-02
  • JavaScript实现的圆形浮动标签云效果实例

    JavaScript实现的圆形浮动标签云效果实例

    这篇文章主要介绍了JavaScript实现的圆形浮动标签云效果,涉及javascript字符串与数组的遍历、排序操作以及元素样式动态操作与数学运算等相关技巧,是非常实用的一段代码,需要的朋友可以参考下
    2015-08-08

最新评论