CoffeeScript - 编译当前目录和所有子目录中的所有 .coffee 文件

发布于 2024-12-26 03:50:40 字数 44 浏览 3 评论 0原文

编译当前目录和所有子目录中的所有 .coffee 文件的最简单方法是什么?

What is the easiest way to compile all .coffee files in the current directory and all sub-directories?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

零度° 2025-01-02 03:50:40

您可以使用集成的 coffee shell 工具来完成此操作:

coffee --output lib --compile src

src 中的 .coffee 文件的目录树编译为 lib 中的 .js 文件的并行树代码>.
查看 http://coffeescript.org/#usage 了解更多详情

you can do so with the integrated coffee shell tool:

coffee --output lib --compile src

compiles a directory tree of .coffee files in src into a parallel tree of .js files in lib.
Check http://coffeescript.org/#usage for more details

半步萧音过轻尘 2025-01-02 03:50:40
coffee -c .

谢谢@TrevorBurnham

coffee -c .

Thanks @TrevorBurnham

情深已缘浅 2025-01-02 03:50:40
coffee --watch --compile .

或者

coffee -wc .

这些命令中的任何一个都将永远运行,监视当前目录中的 *.coffee 文件,并在 *.coffee 文件发生更改时将这些 *.coffee 文件编译为 *.js JavaScript 文件。

如果您希望将 *.js 文件生成到其他目录中,只需添加 --output 或 -o,如下所示:

coffee --watch --output lib --compile src

coffee -w -o lib -c src
coffee --watch --compile .

or

coffee -wc .

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:

coffee --watch --output lib --compile src

or

coffee -w -o lib -c src
茶底世界 2025-01-02 03:50:40

如果您使用的是 *nix 系统:

find -name "*.coffee" -exec coffee -c {} \;

并且您也可以考虑使用 Guardhttps: //github.com/guard/guard-coffeescript

If you are using *nix systems:

find -name "*.coffee" -exec coffee -c {} \;

and you may also consider using Guard: https://github.com/guard/guard-coffeescript

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文