tsconfig.json 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {
  2. // 编译ts:tsc 文件名称
  3. // 编译全部ts:tsc
  4. // 匹配文件入口
  5. // ** 任意文件目录
  6. // * 任意文件
  7. "include": [
  8. "./src/**/*"
  9. ],
  10. // // 匹配文件出口
  11. // "exclude": [
  12. // // "./src/**/*"
  13. // ],
  14. // "extends": 继承
  15. // "files": [ 单独文件
  16. // './src/a.ts',
  17. // ]
  18. // 编译选项
  19. "compilerOptions": {
  20. // 指定ts编译的版本
  21. // 有效值: "es3", "es5", "es6", "es2015", "es2016", "es2017",
  22. // "es2018", "es2019", "es2020", "es2021", "es2022", "es2023",
  23. // "es2024", "esnext"
  24. "target": "ES2015",
  25. // 模块化
  26. // 'none', 'commonjs', 'amd', 'system', 'umd', 'es6',
  27. // 'es2015', 'es2020', 'es2022',
  28. // 'esnext', 'node16', 'node18', 'nodenext', 'preserve
  29. "module": "amd",
  30. // lib 规定ts可以使用什么库
  31. // "lib": ["dom"],
  32. // 指定编译后文件所在目录
  33. "outDir": "./dist",
  34. // 指定所有文件编译后的合并文件
  35. // "outFile": "./dist/app.js",
  36. // 允许编译js文件
  37. "allowJs": true,
  38. // 检查js是否存在报错
  39. "checkJs": true,
  40. // 是否允许错误文件编译
  41. // "noEmitOnError": true,
  42. // 检查是否存在空文件
  43. "strictNullChecks": true,
  44. // 移除注释
  45. "removeComments": true,
  46. // 规定是否允许编译
  47. "noEmit": false,
  48. // 严格模式总开关
  49. "strict": true,
  50. // 允许使用严格模式
  51. // "alwaysStrict": true,
  52. // // 不允许使用隐性this
  53. // "noImplicitThis": true,
  54. // // 不允许数据的默认类型是any
  55. "noImplicitAny": false
  56. }
  57. }