问题描述
请原谅我的无知,但我刚刚使用 npm 安装了 jQuery,在 jQuery 文件之间有一个名为 jquery.slim.js
的文件,什么是 slim
?我知道 min
代表缩小但苗条对我来说是新的!
Excuse my ignorance but I just installed jQuery using npm and between the jQuery files there's a file called jquery.slim.js
, what is slim
? I know the min
stands for minified but slim is new to me!.
btw 我很确定 slim
不像 min
因为还有另一个文件叫做 jquery.slim.min.js
显然它是比普通的纤薄文件轻.
btw I'm pretty sure slim
is not like min
because there's another file called jquery.slim.min.js
and obviously it's lighter than the normal slim file.
还有 slim
文件包含 jQuery 3 beta.(代码中的注释是这样的)
Also the slim
file contains the jQuery 3 beta. (That's what the comments in the code say)
再次为这个愚蠢的问题感到抱歉,但我不知道.
Again sorry for the stupid question but I got no clue.
更新
我正在使用 require
来包含文件,require 是否会在我不知情的情况下包含此文件?与否?
I'm using require
to include the files, would the require include this file without my knowledge? or not?
推荐答案
我不知道 .slim.js
是否是 javascript 库的标准名称扩展,但对于 jQuery,它是一个没有一些扩展名的构建,只需检查文件的开头:
I don't know if .slim.js
is a standard name extension for javascript library, but for jQuery, it is a build without some extensions, just check the beginning of the file:
-ajax,-ajax/jsonp,-ajax/load,-ajax/parseJSON,-ajax/parseXML,-ajax/script,-ajax/var/location,-ajax/var/nonce,-ajax/var/rquery,-ajax/xhr,-manipulation/_evalUrl,-event/ajax,-effects,-effects/Tween,-effects/animatedSelector,-deprecated
通常情况下,您没有 ajax
支持(jQuery.ajax
未定义),没有效果,并且已删除不推荐使用的方法.
Typically you have no ajax
support (jQuery.ajax
is not defined), no effects, and the deprecated method are removed.
关于requireJS,据我所知,如果您需要jquery
,包含"的唯一文件将是jquery.js
,因此您必须明确要求jquery.slim
为了得到 jquery.slim.js
文件,这不是你想要的.
Concerning requireJS, as far as I know if you require jquery
, the only file "included" will be jquery.js
, so you would have to explicitely require jquery.slim
in order to get jquery.slim.js
file included, which is not what you want.
这篇关于file.slim.js 中的什么是 slim的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!