哪个是最好的 javascript 压缩器 UglifyJS 或 YUI 压缩器?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16768094/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Which is the best javascript minifier UglifyJS or YUI compressor?
提问by JS Rocker
Please provide me which is fast and best compressor for Javascript. I have shortlisted these two for my application. Please tell me if you know another best compressor. Thanks in advance.
请为我提供快速且最佳的 Javascript 压缩器。我已将这两个列入我的应用程序的候选名单。请告诉我您是否知道另一种最好的压缩机。提前致谢。
回答by Pushkaraj
Question does not contain criteria for 'Best' :) If you ask me about simple - here is one: JS Miinifyer (http://jscompress.com/)
问题不包含“最佳”的标准:) 如果你问我关于简单的问题 - 这里是一个:JS Miinifyer ( http://jscompress.com/)
- This is simple - copy paste your JS and get the output.
- This checks syntax - it will not compress if there are syntax errors (at least some level of checking I am not sure if it checks details.)
- You can upload JS files also instead of just copy paste.
- 这很简单 - 复制粘贴您的 JS 并获取输出。
- 这会检查语法——如果有语法错误,它不会压缩(至少在一定程度上检查我不确定它是否检查细节。)
- 您也可以上传 JS 文件,而不仅仅是复制粘贴。
We used this for our productions deployments to do: 1. Compression. 2. Uglify JS
我们在生产部署中使用它来执行以下操作: 1. 压缩。2. 丑化 JS