webstorm 自动编译ts

 

1、在目录根目录添加tsconfig.json

  

{
  "compileOnSave": false,
  "compilerOptions": {
    // 文件目录
    "baseUrl": "./",
    // 输出目录,貌似不能和输入目录相同 555
    "outDir": "./js",
    "sourceMap": true,
    "declaration": false,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  }
}

2、配置 file watch

  

 

  

 

posted @ 2018-06-07 09:48  MvloveYouForever  阅读(889)  评论(0编辑  收藏  举报