天天看點

typescript 自動編譯 生成js檔案

項目檔案

<?xml version="1.0" encoding="utf-8"?>

<Project

ToolsVersion="4.0" DefaultTargets="Build" xmlns="">

<Import

Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"

Condition="Exists(‘$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props‘)"

/>

  <PropertyGroup>

    <Configuration

Condition=" ‘$(Configuration)‘ == ‘‘

">Debug</Configuration>

    <Platform Condition="

‘$(Platform)‘ == ‘‘ ">AnyCPU</Platform>

<ProductVersion>

</ProductVersion>

<SchemaVersion>2.0</SchemaVersion>

<ProjectGuid>{942BF143-5F6F-407C-B112-F598D25E001E}</ProjectGuid>

<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>

<OutputType>Library</OutputType>

<TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>

<AppDesignerFolder>Properties</AppDesignerFolder>

<RootNamespace>website</RootNamespace>

<AssemblyName>website</AssemblyName>

<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>

<UseIISExpress>true</UseIISExpress>

<IISExpressSSLPort />

<IISExpressAnonymousAuthentication />

<IISExpressWindowsAuthentication />

<IISExpressUseClassicPipelineMode />

</PropertyGroup>

  <PropertyGroup Condition="

‘$(Configuration)|$(Platform)‘ == ‘Debug|AnyCPU‘ ">

<DebugSymbols>true</DebugSymbols>

<DebugType>full</DebugType>

<Optimize>false</Optimize>

<OutputPath>bin\</OutputPath>

<DefineConstants>DEBUG;TRACE</DefineConstants>

<ErrorReport>prompt</ErrorReport>

<WarningLevel>4</WarningLevel>

‘$(Configuration)|$(Platform)‘ == ‘Release|AnyCPU‘ ">

<DebugType>pdbonly</DebugType>

<Optimize>true</Optimize>

<DefineConstants>TRACE</DefineConstants>

<ItemGroup>

    <Reference

Include="Microsoft.CSharp" />

Include="System.EnterpriseServices" />

  </ItemGroup>

    <Content

Include="ValidateCode.aspx" />

Include="Web.config">

<SubType>Designer</SubType>

</Content>

    <Compile

Include="Global.asax.cs">

<DependentUpon>Global.asax</DependentUpon>

</Compile>

Include="index.aspx.cs">

<DependentUpon>index.aspx</DependentUpon>

<SubType>ASPXCodeBehind</SubType>

Include="index.aspx.designer.cs">

Include="Login.aspx.cs">

<DependentUpon>Login.aspx</DependentUpon>

Include="Login.aspx.designer.cs">

Include="Properties\AssemblyInfo.cs" />

Include="ValidateCode.aspx.cs">

<DependentUpon>ValidateCode.aspx</DependentUpon>

Include="ValidateCode.aspx.designer.cs">

    <None

Include="Web.Debug.config">

<DependentUpon>Web.config</DependentUpon>

</None>

Include="Web.Release.config">

    <Folder Include="ico\"

    <Folder Include="JSTemplete\"

    <Folder Include="log\" />

</ItemGroup>

<VisualStudioVersion Condition="‘$(VisualStudioVersion)‘ ==

‘‘">10.0</VisualStudioVersion>

    <VSToolsPath

Condition="‘$(VSToolsPath)‘ ==

‘‘">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>

  <PropertyGroup Condition="‘$(Configuration)‘

== ‘Debug‘">

<TypeScriptTarget>ES5</TypeScriptTarget>

<TypeScriptRemoveComments>false</TypeScriptRemoveComments>

<TypeScriptSourceMap>true</TypeScriptSourceMap>

<TypeScriptModuleKind>AMD</TypeScriptModuleKind>

== ‘Release‘">

<TypeScriptRemoveComments>true</TypeScriptRemoveComments>

<TypeScriptSourceMap>false</TypeScriptSourceMap>

  <Import

Project="$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets"

Condition="Exists(‘$(VSToolsPath)\TypeScript\Microsoft.TypeScript.targets‘)"

  <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets"

Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets"

Condition="‘$(VSToolsPath)‘ != ‘‘" />

Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets"

Condition="false" />

<ProjectExtensions>

<VisualStudio>

      <FlavorProperties

GUID="{349c5851-65df-11da-9384-00065b846f21}">

<WebProjectProperties>

<UseIIS>True</UseIIS>

<AutoAssignPort>True</AutoAssignPort>

<DevelopmentServerPort>0</DevelopmentServerPort>

<DevelopmentServerVPath>/</DevelopmentServerVPath>

<IISUrl>http://localhost:31620/</IISUrl>

<NTLMAuthentication>False</NTLMAuthentication>

<UseCustomServer>False</UseCustomServer>

<CustomServerUrl>

</CustomServerUrl>

<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>

</WebProjectProperties>

</FlavorProperties>

    </VisualStudio>

</ProjectExtensions>

  <!-- To modify your build process, add

your task inside one of the targets below and uncomment it.

       Other similar extension points exist,

see Microsoft.Common.targets.

  <Target

Name="BeforeBuild">

  </Target>

Name="AfterBuild">

-->

</Project>

注意的部分

  <TypeScriptToolsVersion>1.0</TypeScriptToolsVersion> 

使用1.0版本的ts

<PropertyGroup Condition="‘$(Configuration)‘ ==

‘Debug‘">

以上的代碼就是差别的地方

其實最簡單的辦法,就是安裝完相關的檔案後, 建立一個ts的項目(ts類型項目會自動生成js檔案)。 然後比較和普通網站項目的不同

(*.csproj檔案),添加相關内容就行。