tsconfig.json
{
"compilerOptions": {
"incremental": true, // 增量编译
"tsBuildInfoFile": "./buildFile", // 增量编译文件的存储位置
"diagnostics": true, // 打印诊断信息
"target": "es5", // 目标语言的版本
"module": "commonjs", // 生成代码的模块标准
"outFile": "./app.js", // 将多个相互依赖的文件生成一个文件,可以用在 AMD 模块中
"lib": [], // TS 需要引用的库,即声明文件,es5 默认 "dom", "es5", "scripthost"
"allowJs": true, // 允许编译 JS 文件(js、jsx)
"checkJs": true, // 允许在 JS 文件中报错,通常与 allowJS 一起使用
"outDir": "./out", // 指定输出目录
"rootDir": "./", // 指定输入文件目录(用于输出)
"declaration": true, // 生成声明文件
"declarationDir": "./d"