1

I want to have a combined js file from typescript sources on build. My *.csproj file:

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">

  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.Default.props" />
  <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" />

  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <ProjectGuid>{83A2324A-201F-4CE8-A57B-16770214E3B2}</ProjectGuid>
    <TypeScriptToolsVersion>1.4</TypeScriptToolsVersion>
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">12.0</VisualStudioVersion>
    <TypeScriptCompileOnSaveEnabled>False</TypeScriptCompileOnSaveEnabled>
    <TypeScriptOutFile>..\bin\app.js</TypeScriptOutFile>
    <TypeScriptSourceMap>true</TypeScriptSourceMap>
  </PropertyGroup>

  <ItemGroup>
    <TypeScriptCompile Include="src\TypeScriptCompilerPlugin.ts" />
  </ItemGroup>

  <Target Name="Build" DependsOnTargets="CompileTypeScript">
  </Target>

</Project>

The problem: on build VS generate file src\TypeScriptCompilerPlugin.js, not ..\bin\app.js...

1 Answer 1

3

Solution: import Microsoft.TypeScript.Default.props must be at the top of the file, but import Microsoft.TypeScript.targets must be at the bottom.

Sign up to request clarification or add additional context in comments.

1 Comment

I saw this answer and thought "no way" but after trying it this did solve my problem. Thanks for posting the answer after you found it!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.