8
我正在寻找为TypeScript在Sublime Text中配置构建系统。我目前使用如何为TypeScript配置Sublime构建系统
...
{
"cmd": ["tsc", "$file"],
"selector": "source.ts"
}
我还想设置“file_regex”属性处理错误信息。
任何人都知道该怎么设置?
我正在寻找为TypeScript在Sublime Text中配置构建系统。我目前使用如何为TypeScript配置Sublime构建系统
...
{
"cmd": ["tsc", "$file"],
"selector": "source.ts"
}
我还想设置“file_regex”属性处理错误信息。
任何人都知道该怎么设置?
在OS-X使用此:
{
"cmd": ["tsc","$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
"osx": {
"path": "/usr/local/bin:/opt/local/bin"
}
}
编辑:
这里是为Windows创建的崇高构建系统。测试并按预期工作。然而,你需要在Windows环境tsc.cmd路径,否则你应该在下面的cmd
部分定义根的打字稿命令:
{
"cmd": ["tsc","$file"],
"file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$",
"selector": "source.ts",
"windows": {
"cmd": ["tsc.cmd", "$file"]
}
}
如果你不断收到这样的错误?''[Errno 2]没有这样的文件或目录''' – Diogenes
@Diogenes那么你可能使用ST3,应该使用“shell_cmd”而不是“cmd” – svallory