tsconfig.json ts配置文件解析

tsconfig.json ts配置文件解析

tsconfig

编译选项

示例配置:

{
  "compilerOptions": {
      //指定生成哪个模块系统代码: "None", "CommonJS", "AMD", "System", "UMD", "ES6"或 "ES2015"。
    "module": "commonjs",
        //生成相应的 .d.ts文件。
    "declaration": true,
        //删除所有注释,除了以 /!*开头的版权信息。
    "removeComments": true,
        //给源码里的装饰器声明加上设计类型元数据。
    "emitDecoratorMetadata": true,
        //启用实验性的ES装饰器。
    "experimentalDecorators": true,
        //指定ECMAScript目标版本 "ES3"(默认), "ES5", "ES6"/ "ES2015", "ES2016", "ES2017"或 "ESNext"。
    "target": "es2017",
        //  允许编译javascript文件。
    "allowJs": true,
    "resolveJsonModule": true,
        //生成相应的 .map文件。
    "sourceMap": true,
        //重定向输出目录。
    "outDir": "./dist",
        //解析非相对模块名的基准目录
    "baseUrl": "./",
    "incremental": true
  },
  "exclude": ["node_modules", "dist"]
}

猜你喜欢

转载自www.cnblogs.com/mengfangui/p/12263071.html