webstorm 自动编译ts

时间:2018-06-07 10:20:54   收藏:0   阅读:2101

 

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

  技术分享图片

 

  技术分享图片

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!