tsconfig.json配置

76 阅读1分钟
{
    "compilerOptions": {
        "noImplicitAny":false, //关闭any显示类型
	"incremental": true, //启用增量编译
	"target": "es5", //指定编译的版本
	"module": "commonjs", //指定编译模块
	"outDir": "./dist/js", //将输出结构重定向到目录
	"rootDir": "./src", //ts源文件存放目录
	"strict": true, //启用严格模式
	"esModuleInterop": true, //如果用第三方库没有指定导出模块,开起默认导出模块
	"strictNullChecks": true, //启用严格的空检查
	"forceConsistentCasingInFileNames": true,  //不允许对同一文件进行大小写不一致的引用
	"noUnusedLocals": true, //是否允许未使用的变量报错提示
    },
    "include":["src/**/*"], //编译那个文件下的文件
    "exclude":["node_modules","**/*.spec.ts"] //不编译那个写文件夹
}