2

I'm trying out CoffeeScript support in IntelliJ, and although the highlighting/completion/refactoring support looks great, I can't figure out a way to automatically compile my .coffee files to their .js counterparts in order to use them in web pages, unit tests, etc.

The documentation mentions using Node for this purpose, but I'm primarily interested in writing client side code. I'd probably be able to create a run configuration that would use Cake to create my JS files, but this won't integrate nicely with IDEA's integrated unit test support, etc.

So... any help?

Martin
  • 224
  • 2
  • 9

1 Answers1

2

Use the IntelliJ IDEA plugin: File Watchers.

You would need to install coffee-script package in the global directory. (npm install -g coffee-script).

While you are editing the CoffeeScript file in IntelliJ editor, there would be a notification showing on the top.

Notification

Click "Add watcher" and the IDE will compile your code for you on the fly.

More advanced options could be accessed via Project Settings/File Watchers.

See also the official document.

Mason Wan
  • 118
  • 1
  • 8