[TypeScript] Configuring a New TypeScript Project

时间:2016-06-09 06:20:07   收藏:0   阅读:219

This lesson walks you through creating your first .tsconfig configuration file which will tell the TypeScript compiler how to treat your .ts files.

 

Init a config.json file:

tsc --init

 

tsconfig.json, will be created:

{
    "compilerOptions": {
        "module": "commonjs",
        "target": "es5",
        "noImplicitAny": false,
        "sourceMap": false
    },
    "exclude": [
        "node_modules"
    ]
}

 

Previously, we nee to say:

tsc app.ts

to compile file, now, we don‘t need to do that, it will find ts files and compile when you run ‘tsc‘. notice, node_modules is excluded by default.

 

原文:http://www.cnblogs.com/Answer1215/p/5571857.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!