TS 编译器的配置文件

    1. {
    2. /* 编译器的选项 */
    3. "compilerOptions": {
    4. /* 被编译成的 ES 版本 */
    5. /* esnext 表示最新版本 */
    6. "target": "esnext",
    7. /* 模块化规范的版本 */
    8. "module": "esnext",
    9. "strict": true,
    10. "jsx": "preserve",
    11. "importHelpers": true,
    12. "moduleResolution": "node",
    13. "experimentalDecorators": true,
    14. "skipLibCheck": true,
    15. "esModuleInterop": true,
    16. "allowSyntheticDefaultImports": true,
    17. "sourceMap": true,
    18. "baseUrl": ".",
    19. "types": [
    20. "webpack-env"
    21. ],
    22. "paths": {
    23. "@/*": [
    24. "src/*"
    25. ]
    26. },
    27. /* 项目需要用到的库 */
    28. "lib": [
    29. "esnext",
    30. "dom",
    31. "dom.iterable",
    32. "scripthost"
    33. ]
    34. },
    35. /* 需要编译的文件 */
    36. "include": [
    37. "src/**/*.ts",
    38. "src/**/*.tsx",
    39. "src/**/*.vue",
    40. "tests/**/*.ts",
    41. "tests/**/*.tsx"
    42. ],
    43. /* 不需要编译的文件 */
    44. "exclude": [
    45. "node_modules"
    46. ]
    47. }