Have a .NET Core 2.2 app within a solution and have been using a publish profile to publish to a dev server. Now, Ive setup a Devops build pipleline to publish using a self-hosted agent on-prem. Mostly working but I can't see to get the npm build configuration right.
When I use my publish profile locally, Im using settings in the csproj file to control which options to use for npm build.
eg.
<Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish">
<!-- As part of publishing, ensure the JS resources are freshly built in production mode -->
<!-- Use conditional builds based on build target setting eg. debug, dev, prod etc -->
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build " Condition=" '$(Configuration)' == 'Debug' " />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --prod false --configuration=dev" Condition=" '$(Configuration)' == 'Test' " />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --prod true --configuration=prod" Condition=" '$(Configuration)' == 'Release' " />
<Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr --configuration=prod" Condition=" '$(BuildServerSideRenderer)' == 'true' And '$(Configuration)' == 'Release' " />
However, npm build within my build pipeline isnt run until the publish step. And then its the default "ng build" with no settings to use the correct angular environment value.
On the npm build task I use this for a custom command
build --prod false --configuration=dev
but it doesn't seem to get run during the build.
How can I get the correct npm build settings to run?