Angular 2 .ts文件在Visual Studio 2015 ASP.NET Core项目中保存时不会转换为.js

Der*_*rek 6 visual-studio typescript asp.net-core angular

如果我对ap​​p.component.ts进行了更改并保存文件,则在我手动构建项目之前,更改不会出现在app.component.js中.

我的目标是在保存后在浏览器中反映Angular 2代码更改.我不应该每次都做一次构建.

这是我的tsconfig.json:

{
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}
Run Code Online (Sandbox Code Playgroud)

rgv*_*sar 5

你错过了"compileOnSave": true.该打字稿文档说,它只能与Visual Studio 2015和在Atom打字稿插件的工作原理.它还需要TypeScript 1.8.4或更高版本.

{
  "compileOnSave": true,
  "compilerOptions": {
    "target": "es5",
    "module": "system",
    "moduleResolution": "node",
    "sourceMap": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "removeComments": false,
    "noImplicitAny": false
  },
  "exclude": [
    "node_modules",
    "typings/main",
    "typings/main.d.ts"
  ]
}
Run Code Online (Sandbox Code Playgroud)