跳转至

TypeScript常识

安装和初始化

yarn global add typescript

tsc --init

编译

tsc filename.ts

配置

tsconfig.json

{
    "compilerOptions": {
        "target": "ESNext",
        "module": "CommonJS",
        "moduleResolution": "Node",
        "esModuleInterop": true,
        "resolveJsonModule": true,
        "outDir": "lib",
        "inlineSourceMap": true,
        "declaration": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true
    },
    "include": [
        "src/**/*"
    ]
}

最后更新: 2020年7月31日