Typescript compile on save issues with Angular2 rc5 and VisualStudio2015
<p>I have Angular2 rc5 setup in VS2015 with MVC6 also installed.  I've been having issues with Typescript compileOnSave setting in tsconfig.json.  I've been through all of the fixes I could find including changing the version of typescript in my PATH environmental variable, it is now running 1.8.x instead of 1.0.x. I've tried settings in VS options to compile on save which didn't seem to make a difference. I've tried using the watch setting in tsconfig.json which causes a compile error for me. </p>

<p>I decided to use the gulp-watch and the gulp-typescript feature to have Gulp do it all and while I was testing that out I realized that when I delete any .js files in the "outDir" folder set in my tsconfig.json file it recreates ALL of the .js files automatically. I know this is typescript performing this operation since when I change the outDir setting it does it in that folder instead. Now if I set compileOnSave to false it still does this auto creation of the .js files.  The odd thing is that it will recreate ALL of the .js files even if I only delete one of them.  I was able to figure that out with gulp-watch using the 'change' and 'add' events. </p>

<p>My question is, is this normal for it to recreate all the js and js.map files every time one of the js files gets deleted?  More importantly, how can I get it to compileOnSave as it's supposed to do?</p>

<p>Here's my tsconfig.json file</p>

<pre><code> {
      "compileOnSave": true,
      "compilerOptions": {
        "target": "es5",
        "module": "commonjs",
        "moduleResolution": "node",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "removeComments": false,
        "noEmitOnError": false,
        "noImplicitAny": false,
        "outDir": "./app"
      },
      "exclude": [
        "node_modules",
        "wwwroot",
        "typings/main",
        "typings/main.d.ts"
      ]
    }
</code></pre>

<p>-- UPDATE --</p>

<p>I believe I have this issue resolved. It appears that if you used <a href="https://github.com/Microsoft/TypeScript/issues/8518#issuecomment-229506507" rel="nofollow">this</a> method prescribed for issues with VS2015 typescript errors on compile ex) <code>Invalid module name in augmentation, module '../../Observable' cannot be found</code>, it will cause this compileOnSave problem.  I undid the file swap I made and all is well.  I believe this is a solution found in the <a href="https://angular.io/docs/ts/latest/cookbook/visual-studio-2015.html" rel="nofollow">Angular VS2015 quickstart</a> so this could affect a few people.</p>