1.第一步使用git clone jquery的源代码
//下载到的是最新的jquery版本
git clone git://github.com/jquery/jquery.git
下载指定的jquery版本
git clone git://github.com/jquery/jquery.git
git checkout 2.2.3
2.使用npm install
cd jquery
npm install
3.定制模块
使用:cd到jquery源码的根目录使用grunt命令定制模块
如:
移除ajax模块
grunt custom:-ajax //移除ajax模块
移除多个模块
grunt custom:-ajax,-css,-deprecated,-dimensions,-effects,-event/alias,-offset,-wrap
只打包ajax模块
grunt custom:-css,-deprecated,-dimensions,-effects,-event/alias,-offset,-wrap,-sizzle
4.修改jquery的amd模块名
grunt custom --amd="custom-name"
修改模块名一般较少使用