Issue
I'm working with a default ASP.NET 5 Web project template and trying to determine how to dictate the TypeScript tools and ultimately compiler version for my application.
I'm not yet using Gulp
so this post's answer does not seem to hold water. The reason being, my app even without Gulp has to be told which TypeScript compiler to use. This answer as well wasn't about finding the version but rather using features not yet supported.
In VSNET 2013, the TypeScript tools version and compiler targeted was set in the project's properties:
<TypeScriptToolsVersion>1.7</TypeScriptToolsVersion>
I believe it to be an option of the compilerOptions
section of my tsconfig.json
file. However I get no intellisense for version
and it appears the documentation is sparse. This link states it just emits the compiler's version but doesn't allow specifying it.
I currently have version 1.6 and 1.7 installed on my machine. If there is a need for me to dictate a specific compiler version, how do I set that in an ASP.NET 5 web template? Again the answer isn't immediately to use Gulp because it builds and compiles my .ts
files as is now, so something is dictating the compiler being used.
Solution
It appears the TypeScript Tools (and corresponding compiler version) for ASP.NET 5 projects is set in the following files:
TS 1.7: C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\TypeScript\Microsoft.TypeScript.targets
<PropertyGroup>
<TypeScriptToolsVersion Condition="'$(TypeScriptToolsVersion)'==''">1.7</TypeScriptToolsVersion>
<TscToolPath Condition="'$(TscToolPath)' == ''">$(MSBuildProgramFiles32)\Microsoft SDKs\TypeScript</TscToolPath>
<TscToolExe Condition="'$(TscToolExe)' == ''">tsc.exe</TscToolExe>
<TscYieldDuringToolExecution Condition="'$(TscYieldDuringToolExecution)' == ''">true</TscYieldDuringToolExecution>
</PropertyGroup>
TS 1.8 C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v15.0\TypeScript
<PropertyGroup>
<TypeScriptToolsVersion Condition="'$(TypeScriptToolsVersion)'==''">1.8</TypeScriptToolsVersion>
<!-- Check the default folder for the nuget version of the installer first, if that exists we should use that. -->
<TscToolPath Condition="'$(TscToolPath)' == '' AND Exists('$(MSBuildThisFileDirectory)tsc\tsc.exe') ">$(MSBuildThisFileDirectory)tsc\</TscToolPath>
<TscToolPath Condition="'$(TscToolPath)' == ''">$(MSBuildProgramFiles32)\Microsoft SDKs\TypeScript</TscToolPath>
<TscToolExe Condition="'$(TscToolExe)' == ''">tsc.exe</TscToolExe>
<TscYieldDuringToolExecution Condition="'$(TscYieldDuringToolExecution)' == ''">true</TscYieldDuringToolExecution>
</PropertyGroup>
Notice the 1st line in the configuration above has the value 1.7
for the TypeScript 1.7 compiler.
Answered By - atconway
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.