[TypeScript] Configuring a New TypeScript Project

Posted Answer1215

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了[TypeScript] Configuring a New TypeScript Project相关的知识,希望对你有一定的参考价值。

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.

 

以上是关于[TypeScript] Configuring a New TypeScript Project的主要内容,如果未能解决你的问题,请参考以下文章

ESLint - 为 TypeScript 配置“no-unused-vars”

转Configuring VM Acceleration on Linux

[转] EF Configuring a DbContext

MyBatis(3.2.3) - Configuring MyBatis using XML, Properties

Android SIMPLE: Error configuring

Configuring Beans in the Spring IoC Container