1.第一步使用git clone jquery的源代碼 css
//下載到的是最新的jquery版本 jquery
git clone git://github.com/jquery/jquery.git
下載指定的jquery版本 git
git clone git://github.com/jquery/jquery.git
git checkout 2.2.3
2.使用npm install github
cd jquery
npm install
3.定製模塊 ajax
使用:cd到jquery源碼的根目錄使用grunt命令定製模塊 npm
如: grunt
移除ajax模塊 spa
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
grunt custom --amd="custom-name"
修改模塊名通常較少使用