CoffeeScript: coffee -w name-of-file.coffee complains: “window is not defined”

Viewed 3996

In CofeeScript I am creating a global object by doing this:

window.App = 
  init : ->
    ...

Running coffee -w app.coffee complains window is not defined and doesn't rewrite the app.js file.

However, running coffee -c app.coffee compiles without a problem. How can I get coffee -w to accept global window?

CoffeeScript version is 1.1.1 (from coffee -v)

Thanks!

1 Answers
Related