grunt定製化jquery

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
  
4.修改jquery的amd模塊名
grunt custom --amd="custom-name"
修改模塊名通常較少使用
相關文章
相關標籤/搜索