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.

有帮助吗?

解决方案

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.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top