breeswish
V2EX  ›  Node.js

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

  •  
  •   breeswish · Oct 30, 2013 via Android · 6054 views
    This topic created in 4753 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
    sxd
    Oct 30, 2013
    1
    虽然我不懂coffeescript 但是我知道这类东西 都需要map文件来调试
    ququzone
    ququzone
    Oct 30, 2013❤️1
    2
    我现在是直接用coffee,然后用grunt编译成js执行
    arzusyume
    arzusyume
    Oct 30, 2013❤️1
    3
    我也是用grunt,有个sourceMap参数
    refresh
    refresh
    Oct 30, 2013❤️2
    4
    我是直接写cf,然后用grunt实时编译成js。开发在dev目录,编译到build目录,运行目录在build。
    breeswish
    breeswish
    OP
    Oct 30, 2013
    5
    @ququzone @arzusyume @refresh 感谢大家^_^ 看来编译后执行比较好~
    shiny
    shiny
    PRO
    Oct 30, 2013❤️1
    6
    webStorm 的 file watcher 会自动帮你 coffeescript to javascript,有语法错误马上能检测出来。然后应用的时候直接应用 js 文件即可。
    7anshuai
    7anshuai
    Oct 30, 2013
    7
    业余项目才会玩coffee,我一般直接coffee, 有需要编译可以cake build或者 cake watch
    guangwong
    guangwong
    Oct 30, 2013
    8
    = = 编译就完了丫= =。。。。。。。。
    oklai
    oklai
    Oct 30, 2013❤️1
    9
    编译Coffee,推荐一个工具 http://koala-app.com
    breeswish
    breeswish
    OP
    Oct 30, 2013
    10
    @oklai :) 以前v2ex看到过 不过现在已经习惯grunt了 暂时不会更换~
    其实更大的问题是~ 在团队协作的时候,让其他人npm install再grunt比所有人下载一个koala要方便多了以及更通用,这个在写个人app的时候很方便^_^
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1948 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 60ms · UTC 16:35 · PVG 00:35 · LAX 08:35 · JFK 11:35
    ♥ Do have faith in what you're doing.