title: Build pipeline with .NET Core and Angular but npm build happens during publish task?
body: <p>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.</p>
  
  <p>When I use my publish profile locally, Im using settings in the csproj file to control which options to use for npm build. </p>
  
  <p>eg.<br/></p>
  
  <pre><code>  &lt;Target Name="PublishRunWebpack" AfterTargets="ComputeFilesToPublish"&gt;
      &lt;!-- As part of publishing, ensure the JS resources are freshly built in production mode --&gt;
      &lt;!-- Use conditional builds based on build target setting eg.  debug, dev, prod etc --&gt;
      &lt;Exec WorkingDirectory="$(SpaRoot)" Command="npm run build " Condition=" '$(Configuration)' == 'Debug' " /&gt;
      &lt;Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --prod false --configuration=dev" Condition=" '$(Configuration)' == 'Test' " /&gt;
      &lt;Exec WorkingDirectory="$(SpaRoot)" Command="npm run build --prod true --configuration=prod" Condition=" '$(Configuration)' == 'Release' " /&gt;
      &lt;Exec WorkingDirectory="$(SpaRoot)" Command="npm run build:ssr --configuration=prod" Condition=" '$(BuildServerSideRenderer)' == 'true' And  '$(Configuration)' == 'Release' " /&gt;
  </code></pre>
  
  <p>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.  </p>
  
  <p>On the npm build task I use this for a custom command<Br/></p>
  
  <blockquote>
    <p>build --prod false --configuration=dev</p>
  </blockquote>
  
  <p>but it doesn't seem to get run during the build.</p>
  
  <p>How can I get the correct npm build settings to run?</p>
  
  <p>My build pipeline looks like this
  <a href="https://i.stack.imgur.com/OQpx2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/OQpx2.png" alt="enter image description here"></a></p>