I'm using TypeScript 0.8.3 and trying to get compile on save to work.
I have mine set up just a little different but it should really work. Keep in mind it works fine when I build the project, just not on save:
Obviously the first thing: Tools > Options > Text Editor > TypeScript > Project > Compile on Save set to "Automatically compile TypeScript files which are part of the project"
Then in my .csproj file
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptSourceMap>true</TypeScriptSourceMap>
<TypeScriptIncludeComments>true</TypeScriptIncludeComments>
<TypeScriptGeneratesDeclarations>false</TypeScriptGeneratesDeclarations>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptOutFile>application.js</TypeScriptOutFile>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
<TypeScriptTarget>ES5</TypeScriptTarget>
<TypeScriptSourceMap>false</TypeScriptSourceMap>
<TypeScriptIncludeComments>false</TypeScriptIncludeComments>
<TypeScriptGeneratesDeclarations>false</TypeScriptGeneratesDeclarations>
<TypeScriptModuleKind>AMD</TypeScriptModuleKind>
<TypeScriptOutFile>application.js</TypeScriptOutFile>
</PropertyGroup>
<!-- this imports the code below from Microsoft.Typescript.targets -->
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />
And I changed Microsoft.TypeScript.targets as follows:
<Target Name="CompileTypeScript">
<Message Text="Compiling TypeScript files" />
<Message Text="Creating response file typescriptcompiler.input" />
<WriteLinesToFile
File="typescriptcompiler.input"
Lines=""C:\MyProject\MyProject.Web\Scripts\_references.ts"" <!-- recursively gets individual file paths referenced therein -->
Overwrite="true"
Encoding="Unicode"/>
<Message Text="Executing tsc $(TypeScriptBuildConfigurations) @typescriptcompiler.input" />
<Exec Command="tsc $(TypeScriptBuildConfigurations) @typescriptcompiler.input" />
<Delete Files="typescriptcompiler.input"/>
</Target>
And yet I still have to REBUILD the project to generate my single application.js. Saving a single file does not work.
Note: I had to change Microsoft.Typescript.targets to go around a buffer bug in the WScript library used by tsc when trying to compile too many files at once. Basically the workaround is to write to a file then pass to compiler.
Any ideas why it doesn't recompile on save?
There is this linein the Microsoft.Typescript.targets but it doesn't seem to do anything I tried removing both condition so its always true and there is still no compile on save. What is this supposed to do? :
<TypeScriptCompileOnSaveEnabled Condition="'$(TypeScriptEnableCompileOnSave)' != 'false' and '$(TypeScriptOutFile)' == ''">true</TypeScriptCompileOnSaveEnabled>
