Skip to content

Instantly share code, notes, and snippets.

@newmanbrad
Created August 13, 2018 15:02
Show Gist options
  • Save newmanbrad/e057827571eb0c690442eebb54f22e84 to your computer and use it in GitHub Desktop.
Save newmanbrad/e057827571eb0c690442eebb54f22e84 to your computer and use it in GitHub Desktop.
Adding JavaScript tasks to your MSBuild project.
<!-- custom targets -->
<Target Name="BeforeBuild">
<Message Text="Node Check Started" />
<Exec Command="node || start http://nodejs.org &amp;&amp; echo You need to install NodeJS" ContinueOnError="false" />
<Message Text="Node Check Ended" />
<Message Text="NPM Install Started" />
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" ContinueOnError="false" />
<Message Text="NPM Install Ended" />
<Message Text="Gulp Tasks Started" />
<!--- Some Gulp Task(s) --->
<Exec WorkingDirectory="$(ProjectDir)" Command="node_modules\.bin\gulp someGulpTask" ContinueOnError="false" />
<Message Text="Gulp Tasks Ended" />
<!--- Include any artifact files that we generate so the project is aware of them -->
<ItemGroup>
<Content Include="supercoolpath/supercoolfile.js" />
</ItemGroup>
</Target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment