【发布时间】:2018-09-11 15:42:09
【问题描述】:
我刚刚通过npm install jquery下载了最新版本的jQuery,它包括三个未压缩的文件,即:
dist/core.js
dist/jquery.js
dist/jquery.slim.js
我想知道 core.js 文件是什么,但找不到任何关于它的文档。谷歌搜索 core.js 和 jquery core.js 没有返回相关答案。
另外,我没有看到任何 core.min.js。那是什么?我会使用它吗?
注意:它使用需要 AMD 加载程序的 define()(请参阅 https://requirejs.org/docs/whyamd.html#definition ) 所以它不能直接包含在一个 html 文件中。
一个 jQuery CDN 位于 https://code.jquery.com,但它不包括 core.js(据我所见)。
查看代码,它只定义了少量函数,其中一些是:
extend, each, map, slice, first, last, eq, end
看起来这些也在 jquery.js 和 jquery.slim.js 中定义。
core 的 jQuery 文档https://api.jquery.com/category/core/ 与 core.js 文件中的内容不匹配。
【问题讨论】:
-
不知道为什么它在 dist 但核心大多只是整个库中使用的方法
标签: javascript jquery