1

We have upgraded to Angular 6 so we had to change the ng build env=prod to ng build configuration=production because angular-cli.json is not being used anymore.

Locally, ng build configuration=production works properly and the settings I need in prod were there. But when we trigger the build step/task in azure VSTS, ng build configuration=production does not replace the dev settings to production.

Did anyone encounter this? what did you folks do to fix this?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114
Gani Lastra
  • 245
  • 1
  • 14

1 Answers1

4

First, try changing your syntax to

ng run [project]:build:production

where [project] is replaced with the name of your project as specified in the projects object in angular.json.

For example, if your project is called "my-app", then try

ng run my-app:build:production

Second, in angular.json, make sure that my-app > architect > build > configurations > production is defined the way that you expect.

Third, notice that the output of the build will be dist\[project]\production (assuming your "outputPath" is "dist"). You need to ensure that your VSTS build's artifact include these files (for example, by archiving them into a ZIP and then copying them to $(Build.ArtifactStagingDirectory)).

artfulmethod
  • 631
  • 6
  • 7
  • this is great... Thank you so much. Fixed the issue – Gani Lastra Aug 22 '18 at 06:40
  • Could you take a look at my question: https://stackoverflow.com/questions/52836391/angular-production-release-does-not-create-my-app-folder-in-dist-azure-devops I am not sure what I am doing wrong. – CularBytes Oct 16 '18 at 14:51