coffeescipt compiling

Hi! The excellent support in WebStrom 3.0 is awesome, but I can't make it usefull for me, e.g. I can't find way to automatically compile coffee-script files to js. Is the way exists? Also for older version I use my own console app which trace changes on coffee-script files and then compile them, but now it stops working since "file changed hook" stops working for coffee files in WebStorm 3.0 (that strange).
Some help appreciated.

Comment actions Permalink

I'm hitting this same issue.  It seems WebStorm should automatically compile to xxx.js before launching the debugger.  Yet I cannot find a way to configure this, so instead I am editing my .coffee files in WebStorm, then going out to the command line shell to compile and then back into WebStorm to debug, which seems crazy.  I'm on Mac OS X, if it matters.

Comment actions Permalink

My comment is not specific to CoffeeScipt support (at all) .. but why not use External Tools functionality to make such compilation (with quick shortcut press) instead of going to console ?

Comment actions Permalink

Thanks.  I'll try that.  Although I found a workaround that's working for me now.  I opened a command window and entered the command "coffee --watch --compile".  It runs and watches the file and compiles it everytime I edit and save it in WebStorm.

If anyone knows of the full, best solution, please reply to this thread.  Thanks.

Comment actions Permalink

You also can use coffee -cw "directory" for autocompile all changes (this solution not the best, sometimes fails to work properly)
Or my choise of the moment - coffee-watcher (sudo npm install -g coffee-watcher)

Comment actions Permalink

You could create run configuration that would compile all CoffeeScript files in your project to the specified directory. To do this you perform the following steps:

  1. Install NodeJS plugin for the IDE;
  2. Create Run Configuration of type Node JS;
  3. Put following as path to Node App JS File "./src" (if your sources is located under "src" directory)
  4. Specify path to node executable;
  5. Switch on "Run with CoffeeScript plugin" checkbox;
  6. Specify path to coffee executable;
  7. Put following coffeescript arguments "--compile --output ./out"

Now when you need to compile all the CoffeeScript file in your project you have to launch this run configuration.

Do not hesitate to contact me if you have further questions

Comment actions Permalink

Hi guys.

Actually it's not funny. Trying to set up work with coffee nicely for a week. All I want is a simple way to compile WHOLE directory of my project (not some separated coffee file). With ocasional switches to compiled js files (when debug) . At the moment only way to do this is using coffee-watcher module. Still one problem remains  - if I have both files opened in WebStorm editor (coffee + js) and then coffee-wathcer compiles coffee file, corresponding js file in editor remains not updated (I presume some caching mechanism works here), and to refelect changes on js file I need to switch between WebStorm and some other open window, then back (ALT+Tab, Alt+Tab). After this changes reflectod on js file. Please solve this problem!

Actually thanks for your great IDE, till your version 3.0 working in this node stack on ubuntu was a pain.

Comment actions Permalink

Use "File | Synchronize" (3rd button from the left on main toolbar) after you save the files -- it's faster than switching to another app and back (that's when Synchronize is executed: Settings | General --> Synchronize files on frame activation).

Comment actions Permalink

)) It doesn't work also. I tried this even before recent post. File is actually updated but not in IDE and the most wrong is that when you debug the file, you debug not updated version!

Comment actions Permalink


What should be set as the path to coffee executable on Windows?

I have managed to install coffee on Windows as part of nodejs (
And it works in the command line.
But if I put simple "coffee" as the "path to coffe executable" it returns an error on attempt to run

"C:\Program Files (x86)\nodejs\node.exe" coffee js

        throw e; // process.nextTick error, or 'error' event on first tick
Error: Cannot find module 'D:\Sites\Vera\coffee'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Array.0 (module.js:479:10)
    at EventEmitter._tickCallback (node.js:192:40)

Process finished with exit code 1

Ivan Shakhov

Please sign in to leave a comment.