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.
Thanks.

0
9 comments

I'm hitting this same issue.  It seems WebStorm should automatically compile xxx.coffee 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.

0

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 ?

0

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 hello.coffee".  It runs and watches the hello.coffee 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.

0
Avatar
Permanently deleted user

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)

0

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

0
Avatar
Permanently deleted user

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.

0

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).

0
Avatar
Permanently deleted user

)) 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!

0

Hi,

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

I have managed to install coffee on Windows as part of nodejs (http://www.davidarno.org/2012/02/02/beginners-guide-to-using-coffeescript-on-windows-with-node.js/)
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

node.js:201
        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



Thanks,
Ivan Shakhov
0

Please sign in to leave a comment.