Skip to content

Instantly share code, notes, and snippets.

@michaeljacobdavis
Created February 9, 2013 06:20
Show Gist options
  • Save michaeljacobdavis/4744182 to your computer and use it in GitHub Desktop.
Save michaeljacobdavis/4744182 to your computer and use it in GitHub Desktop.
R.js Minification on TFS build and Publish
cd "$(ProjectDir)Scripts"
node.exe r.js -o build.js
...
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
<!-- Add -->
<PropertyGroup>
<CopyAllFilesToSingleFolderForPackageDependsOn>
MinifiedFiles;$(CopyAllFilesToSingleFolderForPackageDependsOn);
</CopyAllFilesToSingleFolderForPackageDependsOn>
</PropertyGroup>
<Target Name="MinifiedFiles" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<ItemGroup>
<MinifiedScripts Include="Scripts\**\*.built.js" />
<FilesForPackagingFromProject Include="%(MinifiedScripts.Identity)">
<DestinationRelativePath>Scripts\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
<ItemGroup>
<MinifiedSourceMaps Include="Scripts\**\*.built.js.src" />
<FilesForPackagingFromProject Include="%(MinifiedSourceMaps.Identity)">
<DestinationRelativePath>Scripts\%(RecursiveDir)%(Filename)%(Extension)</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment