如何在nodejs里正确用coffeescript开发项目 - V2EX
breeswish

如何在nodejs里正确用coffeescript开发项目

  •  
  •   breeswish Oct 30, 2013 via Android 5640 views
    This topic created in 4577 days ago, the information mentioned may be changed or developed.
    我现在是这么做的。。

    app.js:

    require("coffee-script")
    require("./app.coffee")

    start:

    node app.js

    执行是ok的。。但是。。coffee文件中如果有啥语法错误的话完全无法定位到错误在哪里。。

    所以我猜这一定不是一个common practice
    那大家一般是怎么做的呢
    10 replies    1970-01-01 08:00:00 +08:00
    sxd
        1
    sxd  
       Oct 30, 2013
    虽然我不懂coffeescript 但是我知道这类东西 都需要map文件来调试
    ququzone
        2
    ququzone  
       Oct 30, 2013   1
    我现在是直接用coffee,然后用grunt编译成js执行
    arzusyume
        3
    arzusyume  
       Oct 30, 2013   1
    我也是用grunt,有个sourceMap参数
    refresh
        4
    refresh  
       Oct 30, 2013   2
    我是直接写cf,然后用grunt实时编译成js。开发在dev目录,编译到build目录,运行目录在build。
    breeswish
        5
    breeswish  
    OP
       Oct 30, 2013
    @ququzone @arzusyume @refresh 感谢大家^_^ 看来编译后执行比较好~
    shiny
        6
    shiny  
    PRO
       Oct 30, 2013   1
    webStorm 的 file watcher 会自动帮你 coffeescript to Javascript,有语法错误马上能检测出来。然后应用的时候直接应用 js 文件即可。
    /tr>
    7anshuai
        7
    7anshuai  
       Oct 30, 2013
    业余项目才会玩coffee,我一般直接coffee, 有需要编译可以cake build或者 cake watch
    guangwong
        8
    guangwong  
       Oct 30, 2013
    = = 编译就完了丫= =。。。。。。。。
    oklai
        9
    oklai  
       Oct 30, 2013   1
    编译Coffee,推荐一个工具 http://koala-app.com
    breeswish
        10
    breeswish  
    OP
       Oct 30, 2013
    @oklai :) 以前v2ex看到过 不过现在已经习惯grunt了 暂时不会更换~
    其实更大的问题是~ 在团队协作的时候,让其他人npm install再grunt比所有人下载一个koala要方便多了以及更通用,这个在写个人app的时候很方便^_^
    About     Help     Advertise     Blog     API     FAQ     Solana     3378 Online   Highest 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 43ms UTC 13:01 PVG 21:01 LAX 06:01 JFK 09:01
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86