How to configure Sublime Build System for TypeScript

I want to configure the build system in Sublime Text for TypeScript.

I am currently using ...

{ "cmd": ["tsc", "$file"], "selector": "source.ts" } 

I would also like to set the 'file_regex' property to handle error messages.

Does anyone know what to install?

+8
sublimetext2 typescript
Oct 08 '12 at 10:15
source share
2 answers

Use this on 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" } } 

EDIT:

Here is the Sublime Build System created for Windows. Tested and works as expected. However, you need to include the tsc.cmd path in the Windows environment, otherwise you must define the root in the Typescript command in the cmd section below:

 { "cmd": ["tsc","$file"], "file_regex": "(.*\\.ts?)\\s\\(([0-9]+)\\,([0-9]+)\\)\\:\\s(...*?)$", "selector": "source.ts", "windows": { "cmd": ["tsc.cmd", "$file"] } } 
+12
Oct 08
source share

Now there are two versions. This one or this one . Creating your own is easy by referencing this document .

+1
Oct 08
source share



All Articles