码迷,mamicode.com
首页 > 其他好文 > 详细

[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

时间:2016-06-09 06:15:45      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

This lesson shows you how to install TypeScript and run the TypeScript compiler against a .ts file from the command line.

 

install:

npm install -g typescript

tsc -v // version 

 

app.ts:

class Person{}

 

RUN:

tsc app.ts

You will see the js file with the same name.

 

If you want a different name, you can do :

tsc --out <output_filename> <input_filename>

tsc --out bundle.js app.ts

 

Watch files changes:

tsc -w --out bundle.js app.ts

 

[TypeScript] Installing TypeScript and Running the TypeScript Compiler (tsc)

标签:

原文地址:http://www.cnblogs.com/Answer1215/p/5571840.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!