CoffeeScript - 编译当前目录和所有子目录中的所有 .coffee 文件
编译当前目录和所有子目录中的所有 .coffee 文件的最简单方法是什么?
What is the easiest way to compile all .coffee files in the current directory and all sub-directories?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以使用集成的
coffee
shell 工具来完成此操作:将
src
中的 .coffee 文件的目录树编译为lib
中的 .js 文件的并行树代码>.查看 http://coffeescript.org/#usage 了解更多详情
you can do so with the integrated
coffee
shell tool:compiles a directory tree of .coffee files in
src
into a parallel tree of .js files inlib
.Check http://coffeescript.org/#usage for more details
谢谢@TrevorBurnham
Thanks @TrevorBurnham
或者
这些命令中的任何一个都将永远运行,监视当前目录中的 *.coffee 文件,并在 *.coffee 文件发生更改时将这些 *.coffee 文件编译为 *.js JavaScript 文件。
如果您希望将 *.js 文件生成到其他目录中,只需添加 --output 或 -o,如下所示:
或
or
Either of these commands will run forever, watching for *.coffee files in the current directory, and compiling those *.coffee files into *.js JavaScript files whenever the *.coffee files are changed.
If you want the *.js files to be generated into some other directory, just add --output or -o, like this:
or
如果您使用的是 *nix 系统:
并且您也可以考虑使用
Guard
:https: //github.com/guard/guard-coffeescriptIf you are using *nix systems:
and you may also consider using
Guard
: https://github.com/guard/guard-coffeescript