Skip to content

Instantly share code, notes, and snippets.

@A2H111
Created August 12, 2018 22:49
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 A2H111/828c70969c2bcf41aae2d011a2029229 to your computer and use it in GitHub Desktop.
Save A2H111/828c70969c2bcf41aae2d011a2029229 to your computer and use it in GitHub Desktop.
<Target Name="AfterBuild">
<!-- Ensure Node.js is installed -->
<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 command prompt or IDE." />
<Exec Command="ng build " WorkingDirectory="$(ProjectDir)" Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<Exec Command="ng build" WorkingDirectory="$(ProjectDir)" Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
<ItemGroup>
<_CustomFiles Include="dist\**\*" />
<FilesForPackagingFromProject Include="%(_CustomFiles.Identity)">
<DestinationRelativePath>%(RecursiveDir)%(Filename)%(Extension)
</DestinationRelativePath>
</FilesForPackagingFromProject>
</ItemGroup>
</Target>
<PropertyGroup>
<ExcludeFoldersFromDeployment>
bin;src
</ExcludeFoldersFromDeployment>
<CopyAllFilesToSingleFolderForPackageDependsOn>
AfterBuild;
</CopyAllFilesToSingleFolderForPackageDependsOn>
<CopyAllFilesToSingleFolderForMsdeployDependsOn>
AfterBuild;
</CopyAllFilesToSingleFolderForMsdeployDependsOn>
</PropertyGroup>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment