使用 vscode 编译+运行 typescropt Mac win同理

一、.d.ts文件最好在src/typings 目录下,可在tsconfig.json 文件配置

二、vs 监听文件变化,自动编译ts文件

tsconfig.json

{
  "compilerOptions": {
    "target": "es5",
    "module": "commonjs",
    "baseUrl": "./",
    "outDir": "./bin",
    "paths": {
      "*": [
        "./node_modules/@types",
        "./typings/*"
      ]
    },
    "esModuleInterop": true,
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "skipLibCheck": true
  }
}
posted @ 2022-11-07 18:13  半截肥皂  阅读(66)  评论(0编辑  收藏  举报