在Windows 系統上構建從github獲得的jquery源碼

來源:互聯網
上載者:User

標籤:

從github上下載的jquery檔案是沒有經過壓縮和合并的,根據jquery  README.md  中提供的說明在window構建jquery,進行到最後一步運行grunt時會直接編輯器中開啟grunt.js,不能夠完成構建,需要先在命令列執行:DOSKEY grunt=grunt.cmd $*。下面詳細的構建步驟: 0 安裝github,: http://windows.github.com/1 安裝 NodeJS,:http://nodejs.org/#download2 安裝grunt : npm install -g grunt,安裝完成後在命令列執行 grunt -version 可以查看 grunt的版本 3 從github上clone jquery git clone git://github.com/jquery/jquery.git 如

 

4 在命令提示字元下進入jquery目錄,執行: npm install, 會自動安裝構建需要NodeJS模組,如



5 執行grunt ,在window系統上運行grunt 需要先在命令列執行:DOSKEY grunt=grunt.cmd $* (https://github.com/cowboy/grunt/blob/master/docs/faq.md)

 構建過程中如果提示缺少scr/sizzle/sizzle.js 檔案把檔案拷貝到相應目錄即可

完成上面步驟後在 dist目錄下會有一個jquery.min.js 檔案

grunt 是一個運行在nodeJS環境下的javascript命令列構建工具

項目地址:https://github.com/cowboy/grunt

在Windows 系統上構建從github獲得的jquery源碼

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.