Reputation: 14544
I've already successfully installed TypeScript plugin on Sublime Text 3. After the plugin is installed, it has a build system added to the menu.
You can just use "Command + B" to build .ts file.
What I want is to compile .ts to .js and run the result js file using "node xxx.js" in one "Command + B" command.
How do I configure sublime text 3 build system to do it?
Upvotes: 3
Views: 1243
Reputation: 4146
Assuming that both tsc
and node
are in your system PATH
, the following configuration should work:
{
"cmd": ["tsc $file && node $file_base_name.js"],
"shell": true,
"selector": "*.ts"
}
See Build Systems – Configuration for more on what is going on here.
Upvotes: 1