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"
修改模块名通常较少使用
相关文章
相关标签/搜索