0

I'm using django-coffeescript in my project. But there is some with conversion.

In my hello.coffee file:

hello = ()->
  console.log 'Hello'

But it converts to:

// Generated by CoffeeScript 1.6.3
(function() {
   var hello;

   hello = function() {
     return console.log('hello');
   };

}).call(this);

I want:

var hello = function() {
  return console.log('hello');
}
Bulgantamir
  • 1,514
  • 1
  • 14
  • 21
  • What affordances are there for you to compile without the closure wrapper? @mariodev mentions the -b flag, which will compile the coffeescript as "bare". (http://coffeescript.org/#usage) – max Jan 18 '14 at 15:40
  • possible duplicate of [CoffeeScript & Global Variables](http://stackoverflow.com/questions/4214731/coffeescript-global-variables) – mu is too short Jan 18 '14 at 19:09

1 Answers1

1

Maybe you can override COFFEESCRIPT_EXECUTABLE in your settings.py like so:

COFFEESCRIPT_EXECUTABLE = 'coffee -b'
mariodev
  • 13,928
  • 3
  • 49
  • 61