autocompile .coffee文件和重新加载项目 [英] autocompile .coffee files and reload project
问题描述
我有一个在节点开发的小型网络服务,我想在coffeescript中编码一些文件,开始使用它。
I have a small web service developed in node, and I'd like to code some files in coffeescript, to start playing with it.
我使用nodemon运行应用程序,像这样
I'm using nodemon to run the app, like this
nodemon app.js
我有以下文件结构
app.js
controllers /
ping.coffee
test.js
app.js controllers/ ping.coffee test.js
在 nodemon的主页它说它支持coffeescript,但我更改的文件,它不会重新加载。
In nodemon's homepage it says that it supports coffeescript, but I change the file and it won't get reloaded.
然后我发现这篇文章,所以我试过
Then I found this article, so I tried with
$ coffee --watch --compile ./controllers/*.coffee
并且它工作正常,但如果我尝试
And it works fine, but if I try with
$ coffee --watch --compile ./*.coffee
File not found: ./*.coffee
所以看起来似乎watch选项不是递归的。
So it seems like the watch option is not recursive.
任何想法如何让nodemon选择coffeescript文件更改,或有咖啡编译器
Any idea how can I make nodemon pick coffeescript files changes, or have the coffee compiler pick files recursively?
推荐答案
这应该可以工作:
coffee --watch --compile ./
-wc
的标志。
这篇关于autocompile .coffee文件和重新加载项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!