如何在Brackets中编写TypeScript和CoffeeScript?

use*_*458 5 javascript coffeescript typescript adobe-brackets

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

bas*_*rat 10

对于TypeScript

intellisence /语法突出显示/实时错误检查

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

编译为vanilla JS

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

如何在html页面中引用它

script如果您刚开始使用JavaScript,那么就像使用普通标记一样指向生成的JS .

或者你也可以使用RequireJS http://requirejs.org/