作者热门文章
- Java 双重比较
- java - 比较器与 Apache BeanComparator
- Objective-C 完成 block 导致额外的方法调用?
- database - RESTful URI 是否应该公开数据库主键?
我已经在 Sublime Text 3 上成功安装了 TypeScript 插件。插件安装后,它在菜单中添加了一个构建系统。
您可以只使用“Command + B”来构建 .ts 文件。
我想要的是将 .ts 编译为 .js 并在一个“Command + B”命令中使用“node xxx.js”运行结果 js 文件。
我如何配置 sublime text 3 构建系统来做到这一点?
最佳答案
假设 tsc
和 node
都在您的系统 PATH
中,以下配置应该有效:
{
"cmd": ["tsc $file && node $file_base_name.js"],
"shell": true,
"selector": "*.ts"
}
参见 Build Systems – Configuration有关这里发生的事情的更多信息。
关于typescript - 如何在 sublime Text 3 的一次构建中编译 TypeScript 并运行结果 .js 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39533946/
我是一名优秀的程序员,十分优秀!