| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- {
- // tsc 编译全部文件
- // tsc -w 监听编译
- // tsc xxx.ts
- /*
- ./ 同级
- ../ 上一级
- 任意目录 **
- 任意文件 *
- */
- // 匹配入口文件
- "include": [
- "./src/**/*"
- ],
- // 排除文件入口
- // "exclude": [
- // "./src/**/*"
- // ],
- // "files": [ 单文件
- // "./src/a.ts",
- // ],
- // "extends": 继承
- // 编译选项
- "compilerOptions": {
- // "ignoreDeprecations": "6.0",
- // 指定ts编译成哪个js的版本
- // 'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'es2023', 'es2024', 'esnext'.
- "target": "es6",
- // 模块"commonjs", "amd", "system", "umd", "es6", "es2015", "es2020", "esnext", "none", "es2022", "node16", "node18", "node20", "nodenext", "preserve"
- "module": "amd",
- // 用于规定使用什么库
- "lib": ["DOM","ES2015"],
- // 将编译后的文件放在哪个位置
- "outDir": "./dist",
- // 将编译后的所有文件全部放到一个文件下
- // "outFile": "./dist/app.js"
- // 是否对js文件进行编译
- // "allowJs": true,
- // // 是否对js文件进行检查
- // "checkJs": true
- // 是否移除注释
- // "removeComments": true
- // 是否对错误进行编译 检查 影响生成
- // "noEmitOnError": false
- // 只检查 不影响生成 false
- // 不生成 true
- // 类型检查出错误 不输出
- "noEmit": false,
- "strict": true,
- // 编译后的文件是否是严格模式
- "alwaysStrict": true,
- // 规定是否允许使用this
- "noImplicitThis": true,
- // 不允许使用默认类型的any
- "noImplicitAny": false,
- "strictNullChecks": true
- }
- }
|