The \"Compile on save\" feature isn\'t working for me after upgrading to Visual Studio 2015. When I make a change to a .ts
file in my project and save, the sta
In my case, I had installed Visual Studio Community 2015 along side VS 2012. I had been using Web Essentials for typescript in 2012 which appeared to conflict with 2015.
Uninstalling Web Essentials in 2012 fixed the issue for me.
I had a similar but not the same issue in Visual Studio 2019
I installed the older version, TypeScript 2.9, restarted VS and then it burst into life
For me it was this option in tsconfig.json
:
"compileOnSave": true,
"compilerOptions": { ... },
Restart Visual Studio for this change to take effect.
Not sure if this will help anyone.
I though I was having issues compiling, but it was compiling on save. I just didn't have my solution explorer toolbar toggled to show all files.
The file was there, just waiting impatiently to be added to the project.
Solution:
For me, and I am quite sure this is also the case for others, this was due to a mistake in the tsconfig.json.
You need to add "compileOnSave": true. But in the global section not inside compilerOptions.
Wrong:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5",
"compileOnSave": true
},
"exclude": [
"node_modules",
"wwwroot"
]
}
Correct:
{
"compilerOptions": {
"noImplicitAny": false,
"noEmitOnError": true,
"removeComments": false,
"sourceMap": true,
"target": "es5"
},
"compileOnSave": true,
"exclude": [
"node_modules",
"wwwroot"
]
}
Best regards,
Anders Both Basechat.
Exact same problem here.
I am using Visual Studio 2015 update 3 and TypeScript 2.9.2.0. In tools/options/projects and solutions/external web tools, I upgraded $(PATH) to the second position.
With all these configurations, compileOnSave: true doesn't work for me. The workaround solution is open a command line, run ng build --watch
on the side and let node take care of auto compilation