如何缩小您的 jQuery 代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5832586/
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

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-26 19:52:44  来源:igfitidea点击:

How to minify your jQuery code?

jqueryminify

提问by good_evening

Possible Duplicate:
How to minify jquery files?

可能的重复:
如何缩小 jquery 文件?

Are there any tools, which can minify jQuery code, like jQuery.com do it itself?

是否有任何工具可以缩小 jQuery 代码,例如 jQuery.com 自己做?

采纳答案by IanGilham

You might try Google's Closure tools. There is an online minifier serviceas well.

你可以试试 Google 的Closure tools。还有一个在线压缩器服务

回答by Jimmy Sawczuk

I've used YUI Compressorin the past. It's easy to use and it does a really good job.

我过去使用过YUI Compressor。它易于使用,而且做得非常好。

回答by alexl

yui compressor: http://developer.yahoo.com/yui/compressor/

yui 压缩器:http: //developer.yahoo.com/yui/compressor/

Hope this helps.

希望这可以帮助。

回答by Joseph

You might want to take a look at YUI Compressor

你可能想看看YUI Compressor

It can compress javascript and css.

它可以压缩javascript和css。

回答by ShaneBlake

There is also the Ajax Minifier from Microsoft:

还有来自 Microsoft 的 Ajax Minifier:

http://www.asp.net/ajaxlibrary/AjaxMinDocumentation.ashx

http://www.asp.net/ajaxlibrary/AjaxMinDocumentation.ashx

You can even add it as a build job to a asp.net project and it will minify any javascript or css everytime it publishes. That way, you don't have to keep up with two references and still get readable versions to debug with...

您甚至可以将其作为构建作业添加到 asp.net 项目中,它会在每次发布时缩小任何 javascript 或 css。这样,您不必跟上两个引用,并且仍然可以获得可读版本以进行调试......

回答by neebz

If you are on Visual Studio, Chirpy is the best.

如果你使用的是 Visual Studio,Chirpy 是最好的。