LoginSignup
19
20

More than 5 years have passed since last update.

Coffeescriptのデバッグと自動コンパイル

Last updated at Posted at 2012-07-13

CoffeeScriptのデバッグについて

ChromeプラグインのCoffeeConsoleを使う。
下記からインストールすると、ChromeのデバッガにCoffeeConsoleというタブが追加され、そのConsoleからCoffeescriptを実行できるようになる。Javascriptを書かなくて済む。
https://chrome.google.com/webstore/detail/ladbkfdlnaibelfidknofapbbdlhadfp

自動コンパイルについて

自動コンパイルは、フレームワークが吸収してくれる場合は特に問題ないが、野良で書くときはけっこう悩む
色々ためしたけど、結局coffeeコマンドの自動監視オプションに落ち着いた。

自動コンパイル
%coffee -w -c *.coffee
12:58:34 - compiled coffee.coffee
12:58:34 - compiled test.coffee```

###他に検討したもの
####1.vimで保存時に自動コンパイル
長い間これを使っていたが、保存のたびにチカチカ画面をロードするのがうっとうしい
http://d.hatena.ne.jp/yogit/20110710/1310269515

####2.ブラウザで直接Coffeescriptを読み込む
Chromeだと、起動オプションをつけないとうまく動かないらしい。起動オプションをつけたら重たくなって使い物にならなかったので、断念した。

```html:coffeescript
<script type="text/coffeescript">
    console.log "hello coffee"
</script>
19
20
6

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
19
20