jquery-min 版本?
我注意到大多数 JavaScript 库(例如 jQuery)总是有一个“min”版本(代表 mini?)。
有什么区别?功能较少但尺寸较小?
这是有人应该考虑使用的东西吗? (有很多最小版本。)
I noticed that there is always a "min" version (stands for mini?) for most JavaScript libraries (e.g., jQuery).
What is the difference? Less functionality but smaller size?
Is this something someone should consider using? (There are a lot of min versions out there.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
它被“缩小”了。所有功能都在那里,只是在一个缩小版中,该版本更小以节省传输带宽。
要“缩小”的事情:
这是一个
例子
Its been "minified". All the functionaility is there, just in a minified version that is smaller for saving transfer bandwidth.
Things to become "minified":
Here is an example
could be come
缩小版本只是删除了空格,以使其下载速度更快。否则,它们是相同的。
Minified versions just have whitespace removed, to make them faster to download. Otherwise, they are identical.
不,完全相同的功能,文本已最小化以减少下载,这意味着您无法真正在其中进行调试,但您确实获得了相同的功能
no, exactly the same function, the text has been minimized to reduce the download, this means you cant really debug in it but you do get the same functionality
尺寸更小,因为所有空白都从文件中删除。只需在文本编辑器中打开这两个文件,您就会看到。
Smaller size because all of the white space is removed from the file. Just open both files in text editor and you will see.
这是文件大小较小(缩小)的 jQuery 版本。功能相同,只是浏览器需要下载的文件较小。
This is a version of jQuery that has a smaller file size (minified). Same functions, just a smaller file that the browser has to download.
相同的功能...更小的尺寸。将其视为穷人的压缩。他们只是删除所有不必要的空白。
same functions...smaller size. Think of it as poor mans compression. They simply remove all unneccessary whitespace.
如果您查看 jquery.com,您通常会看到缩小版本被分类为“生产”版本。除此之外,正如其他人所说,它们是同一个文件,一个比另一个大(字节大小)。
If you look at jquery.com you'll usually see the minified version is classified as the "production" version. Other than that, as others have said, they're the same file, one larger (byte size) than the other.
功能完全相同 - 只需在文本编辑器中打开缩小版本和“正常”版本,您就会看到差异。
最小版本只是为了减少文件大小,节省带宽和流量;-)
The functionality is exactly the same - just open the minified and the "normal" versions in a text editor and you'll see the difference.
The min-Versions are just there to provide reduced filesize, to save you bandwith and traffic ;-)