2

Related, but hoping for a lower friction answer: How do I use Node and Express with coffeescript and requirejs?

I've got connect-assets set up so that I can have .js and .coffee files side by side in my /assets/js folder. Only problem: I have to re-get the page containing any compiled coffee files whenever those files change. Minor problem I guess, but I've been doing a lot of CURL on the files themselves as part of troubleshooting -- doing a CURL on the coffee js file itself won't cause it to be recompiled.

Does connect-assets have any sort of 'watch' feature? Couldn't find one in the docs. Do I have to just put a coffee -bcw *.coffee running in that directory?

Edit: In the end I just used grunt to recompile on change. That's worked much better than connect-assets. I'll leave this question here because it's got some views.

Community
  • 1
  • 1
jcollum
  • 43,623
  • 55
  • 191
  • 321

1 Answers1

0

I'm not sure if I understand what you're asking 100%, but have you considered using something like node-supervisor? This can watch CoffeeScript files (and other resources) and restart your node process when they're modified. I've used it with connect-assets successfully.

carpeliam
  • 6,691
  • 2
  • 38
  • 42
  • See the "Edit" above, I added that a few days ago – jcollum Jul 21 '13 at 18:04
  • Sure. I figured you were leaving the problem up so that in case someone had a similar issue, they could find solutions here, so I offered a solution with that in mind. – carpeliam Jul 21 '13 at 19:43
  • Yeah that's sorta what I'm doing, but I was looking for a connect-assets specific solution without adding in another tool. In the end I just added in another tool but I wonder if I just wasn't using connect-assets correctly. – jcollum Jul 21 '13 at 19:49