{// 編譯選項"compilerOptions": {// 生成代碼的語言版本:將我們寫的 TS 代碼編譯成哪個版本的 JS 代碼// 命令行: tsc --target es5 11-測試TS配置文件.ts"target": "es5",// 指定要包含在編譯中的 library"lib": ["dom", "dom.iterable", "esnext"],// 允許 ts 編譯器編譯 js 文件"allowJs": true,// 跳過類型聲明文件的類型檢查"skipLibCheck": true,// es 模塊 互操作,屏蔽 ESModule 和 CommonJS 之間的差異"esModuleInterop": true,// 允許通過 import x from 'y' 即使模塊沒有顯式指定 default 導出"allowSyntheticDefaultImports": true,// 開啟嚴格模式"strict": true,// 對文件名稱強制區分大小寫"forceConsistentCasingInFileNames": true,// 為 switch 語句啟用錯誤報告"noFallthroughCasesInSwitch": true,// 生成代碼的模塊化標準"module": "esnext",// 模塊解析(查找)策略"moduleResolution": "node",// 允許導入擴展名為.json的模塊"resolveJsonModule": true,// 是否將沒有 import/export 的文件視為舊(全局而非模塊化)腳本文件"isolatedModules": true,// 編譯時不生成任何文件(只進行類型檢查)"noEmit": true,// 指定將 JSX 編譯成什么形式"jsx": "react-jsx"},// 指定允許 ts 處理的目錄"include": ["src"]
}
{// 編譯選項"compilerOptions": {// 編譯ES5"target": "es5",// 指定模塊系統"module": "esnext",// 模塊基礎目錄"baseUrl": "./",// 解析導入模塊"moduleResolution": "node",// 相對于模塊路徑"paths": {"@/*": ["src/*"]},// 默認庫"lib": ["esnext", "dom", "dom.iterable", "srcipthost"]}
}
?