tsconfig.json 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. {
  2. // 编译全部ts文件:tsc
  3. // 自动编译全部ts文件:tsc -w
  4. // 包含
  5. // "include": [
  6. // ** 任意文件目录
  7. // * 任意文件
  8. // "./src/**/*"
  9. // ],
  10. // 排除
  11. // "exclude": [
  12. // "./src/**/*"
  13. // ],
  14. // "extends" 继承
  15. // files 文件
  16. // 编辑选项
  17. "compilerOptions": {
  18. // 模板 => Node
  19. "moduleResolution": "Node",
  20. // target规定了 ts编译成那个js的版本:'es5', 'es6', 'es2015', 'es2016', 'es2017', 'es2018', 'es2019', 'es2020', 'es2021', 'es2022', 'esnext'
  21. "target": "ES2015",
  22. // 模块 "CommonJS", "AMD", "System", "UMD", "ES6", "ES2015", "ES2020", "ESNext", "None", "ES2022", "Node16", "NodeNext", "Preserve".
  23. "module": "system",
  24. // lib 规定允许使用什么库
  25. "lib": ["dom"],
  26. // outDir 规定将编译后的文件具体放在那个位置
  27. "outDir": "./dist",
  28. // outFile 将编译后的所有文件放在一个文件夹下
  29. "outFile": "./dist/hello.js",
  30. //allowJs 允许编译js文件
  31. "allowJs": true,
  32. // checkJs 檢查js文件是否符合编译规范
  33. "checkJs": true,
  34. // removeComments 是否移除注释
  35. "removeComments": true,
  36. // noEmitOnError 规定错误是否允许编译
  37. // "noEmitOnError": true,
  38. // noEmit 规定文件是否被编译
  39. // "noEmit": true
  40. // 是否开启严格模式
  41. "strict": false
  42. // alwaysStrict 编译后的文件是否按照严格模式执行
  43. // "alwaysStrict": false,
  44. // // 不允许数据默认是any类型
  45. // "noImplicitAny": true,
  46. // // 规定是否允许使用this
  47. // "noImplicitThis": true,
  48. // // 检查是否为空
  49. // "strictNullChecks": true
  50. }
  51. }