sublime之外掛程式CoffeeScript

來源:互聯網
上載者:User

標籤:style   http   color   os   strong   ar   2014   line   

    各位看官,小生最近在做前端自動化這塊,小有成效,記之,勿忘,同時為後來者前行做一個路標。

    作業系統:win8

    編輯器:Sublime


  1. 安裝外掛程式

       a     ctrl+shift+p,輸入install,斷行符號,

                

      b    輸入CoffeeCompile

            

2.    安裝node


3.    安裝grunt,命令:npm install -g grunt-cli

       安裝coffee-script,命令:npm install -g coffee-script


4.    下載jashkenas-coffeescript,官方地址:https://github.com/jashkenas/coffeescript

                                                  我的地址: http://pan.baidu.com/s/1hq7nF5U 密碼: ckcu

5.    添加coffee.cmd到node安裝目錄,

                    

        coffee.cmd內容如下:

                @echo  off

                node.exe 步驟4 jashkenas-coffeescript的安裝目錄 %*

6.    添加環境變數 NODE_PATH=C:\Users\你的使用者名稱\AppData\Roaming\npm\node_modules;

       

7.    sublime添加編譯

       在Tools->build system->中點擊 new build system,

       出現

將如下內容覆蓋:

{

"cmd": ["coffee.cmd的所在路徑", "$file"],


    "file_regex": "^(...*?):([0-9]*):?([0-9]*)",


    "selector": "source.coffee",

"encoding":"cp936"

}

8.    添加文法高亮:下載CoffeeScript.tmLanguage,地址:https://github.com/jashkenas/coffee-script-tmbundle/blob/master/Syntaxes/CoffeeScript.tmLanguage

        覆蓋到:C:\Users\使用者名稱\AppData\Roaming\Sublime Text 2\Packages\CoffeeScript

9.    在需要自動重新整理的頁面添加<script src="//localhost:35729/livereload.js"></script>

10.    在項目中添加package.json和Gruntfile.js,通過node.js command prompt工具,切到指定目錄,敲擊命令:grunt

11.     樣本Demo  http://pan.baidu.com/s/1sjnY5FB 密碼: 62vb

12.     趕緊學習文法,翱翔吧! http://coffeescript.org/


聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.