8

I'm looking to configure a Build System in Sublime Text for TypeScript.

I'm currently using...

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

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

Anyone know what to set this to?

2 Answers 2

12

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 working as expected. However you need to include tsc.cmd path in the windows environment, otherwise you should define the root to 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"]
    }
}
Sign up to request clarification or add additional context in comments.

2 Comments

What if you keep getting a an error like so?: [Errno 2] No such file or directory
@Diogenes Then you are probably using ST3 and should use "shell_cmd" instead of "cmd"
1

There are two versions now. This one, or this one. Creating your own is easy, by referring to this document.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.