如何让你的visual studio自动编译typescript

来源:互联网 发布:mysql select count 编辑:程序博客网 时间:2024/06/05 21:16

1,先安装typescript语言.

2,卸载项目

3, 编辑项目信息,在<PropertyGroup>并行节点下,添加如下节点信息:

     <PropertyGroup Condition="'$(Configuration)' == 'Debug'">
          <TypeScriptTarget>ES5</TypeScriptTarget>
          <TypeScriptRemoveComments>false</TypeScriptRemoveComments>
          <TypeScriptSourceMap>true</TypeScriptSourceMap>
          <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
      </PropertyGroup>
      <PropertyGroup Condition="'$(Configuration)' == 'Release'">
          <TypeScriptTarget>ES5</TypeScriptTarget>
          <TypeScriptRemoveComments>true</TypeScriptRemoveComments>
          <TypeScriptSourceMap>false</TypeScriptSourceMap>
          <TypeScriptModuleKind>AMD</TypeScriptModuleKind>
      </PropertyGroup>
      <Import Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets" Condition="Exists('$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets')" />