Last active
September 30, 2020 17:09
-
-
Save kagundajm/b6ffaa4ab7c1c163371e29431d4e7c2a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="NpmInstall" BeforeTargets="Build" Condition=" '$(Configuration)' == 'Debug' And !Exists('$(NodeModules)') "> | |
<Exec Command="node --version" ContinueOnError="true"> | |
<Output TaskParameter="ExitCode" PropertyName="ErrorCode" /> | |
</Exec> | |
<Error Condition="'$(ErrorCode)' != '0'" Text="Node.js is required to build and run this project. To continue, please install Node.js from https://nodejs.org/, and then restart your project build process." /> | |
<Message Importance="high" Text="Restoring project dependencies using 'npm'. This may take several minutes..." /> | |
<Exec WorkingDirectory="$(ProjectDir)" Command="npm install" /> | |
</Target> | |
<Target Name="NpmRunBuild" BeforeTargets="Build" DependsOnTargets="NpmInstall"> | |
<Exec WorkingDirectory="$(AssetsRoot)" Command="npm run build" /> | |
</Target> | |
<Target Name="NpmRunPublish" BeforeTargets="Publish" DependsOnTargets="NpmInstall"> | |
<Exec WorkingDirectory="$(AssetsRoot)" Command="npm run publish" /> | |
</Target> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment