如何在Brackets中编写TypeScript和CoffeeScript?

时间:2014-07-01 10:27:31

标签: javascript coffeescript typescript adobe-brackets

我想在Brackets代码编辑器中编写TypeScript和CoffeeScript,但我遇到了困难。如何将其编译为vanilla js?如何在html页面中引用它?

1 个答案:

答案 0 :(得分:10)

对于TypeScript

intellisence / syntax highlighting / live error checking

您需要brackets-typescript插件:https://github.com/fdecampredon/brackets-typescript

编译为vanilla JS

您可以使用grunt为您执行此操作:https://github.com/grunt-ts/grunt-ts。只要将文件保存在括号(或任何其他编辑器)中,它就可以编译项目。输出是JavaScript

如何在html页面中引用它

如果您刚开始使用JavaScript,则指向生成的JS,其中包含正常的script标记。

或者,您可以使用RequireJS http://requirejs.org/

之类的内容