Skip to content

Instantly share code, notes, and snippets.

@simoneb simoneb/readme
Last active Dec 14, 2015

Embed
What would you like to do?
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
You can’t perform that action at this time.