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.
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.
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?
Here's my tsconfig.json file
{
"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"
]
}
-- UPDATE --
I believe I have this issue resolved. It appears that if you used this method prescribed for issues with VS2015 typescript errors on compile ex) Invalid module name in augmentation, module '../../Observable' cannot be found, 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 Angular VS2015 quickstart so this could affect a few people.