Run angular production release after dotnet publish
in .csproj
<Target Name="Build Angular" Condition="'$(Configuration)'=='Release'" BeforeTargets="Build"> <Message Text="* * * * * * Building Angular App * * * * * *" Importance="high"/> <Exec Command="npm run build"/></Target>
and then in package.json
"scripts": { "build": "npm run build --prod"}
You may use any task runner or custom script that will call all these commands together one by one.
For example, you may define a custom npm script in package.json
:
{ ... "scripts": { "apppublish": "dotnet publish -c release && npm run build --prod", ... }}
and then just call npm run apppublish
when you need to publish app.