Skip to content

Instantly share code, notes, and snippets.

@yukitos
Last active August 29, 2015 13:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yukitos/10523927 to your computer and use it in GitHub Desktop.
Save yukitos/10523927 to your computer and use it in GitHub Desktop.
MSBuild snippet to build TypeScript sourcemap files in F# MVC 5 project.
<PropertyGroup>
<!-- snip -->
<TypeScriptToolsVersion>1.0</TypeScriptToolsVersion>
</PropertyGroup>
<Target Name="BeforeBuild">
<MSBuild.ExtensionPack.FileSystem.File TaskAction="Replace" RegexPattern="&lt;dependentAssembly&gt;([\s]+.)&lt;assemblyIdentity name=&quot;FSharp\.Core&quot; publicKeyToken=&quot;b03f5f7f11d50a3a&quot; culture=&quot;neutral&quot; \/&gt;([\s\S]+?)&lt;\/dependentAssembly&gt;" RegexOptionList="IgnoreCase|Singleline" Replacement="&lt;dependentAssembly&gt;&#xD;&#xA; &lt;assemblyIdentity name=&quot;FSharp.Core&quot; publicKeyToken=&quot;b03f5f7f11d50a3a&quot; culture=&quot;neutral&quot; /&gt;&#xD;&#xA; &lt;bindingRedirect oldVersion=&quot;0.0.0.0-$(TargetFSharpCoreVersion)&quot; newVersion=&quot;$(TargetFSharpCoreVersion)&quot;/&gt;&#xD;&#xA; &lt;/dependentAssembly&gt;" Files="web.config" />
<ItemGroup>
<TSFiles Include="@(None);@(TypeScriptCompile)" Condition=" '%(Extension)' == '.ts' " />
</ItemGroup>
<Exec Command="&quot;$(PROGRAMFILES)\Microsoft SDKs\TypeScript\$(TypeScriptToolsVersion)\tsc.exe&quot; &quot;%(TSFiles.Identity)&quot; --sourcemap" />
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment