Skip to content

Instantly share code, notes, and snippets.

@simoneb
Last active December 14, 2015 03:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save simoneb/5021925 to your computer and use it in GitHub Desktop.
Save simoneb/5021925 to your computer and use it in GitHub Desktop.
TypeScript - Sublime Text2 build system configuration
1 - Copy the file typescript.sublime-build in %appdata%\Sublime Text 2\Packages\User
2 - Edit a .ts file
- CTRL+B will compile to .js and save to the same path as the .ts file
- CTRL+SHIFT+B will compile to .js and create+run an HTML page which embeds the script
{
"cmd": ["tsc.exe", "$file"],
"selector": "source.ts",
"variants": [
{
"cmd": ["tsc.exe", "--exec", "$file"],
"name": "Run standalone"
},
{
"cmd": ["echo ^<!DOCTYPE html^>^<html^>^<head^>^<title^>TypeScript - $file_base_name^</title^>^</head^>^<body^>^<script src='file://$file_path/$file_base_name.js'^>^</script^>^</body^>^</html^>",
">",
"%temp%/typescript_$file_base_name.html",
"&&",
"tsc.exe",
"$file",
"&&",
"start",
"%temp%/typescript_$file_base_name.html"],
"name": "Run",
"shell": true
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment