'Can't upgrade to Angular 13

I have an Angular project which I am trying to upgrade from Angular 11 to Angular 13. I followed the instructions here and here. So basically I upgraded first to 12 and then to 13. Now when I try to build it I get this error $ ng build ux-prod --aot=true --buildOptimizer=true --sourceMap=false --configuration production=true An unhandled exception occurred: Configuration 'production=true' is not set in the workspace. This is my angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
...
    "ux-prod": {
      "root": "src_prod/main",
      "sourceRoot": "src_prod/main/webapp/",
      "projectType": "application",
      "architect": {
...
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "ux:build",
            "proxyConfig": "proxy.conf.js",
            "host": "localhost"
          },
          "configurations": {
            "production": {
              "browserTarget": "ux:build:production"
            }
          }
        },
...
      }
    }
  },
...
}

I looked at other posts that describe a similar issue and all of them mention the prod config not being present. But in my case i see it under the "serve" node. How do i fix it? The file angular.json has not been changed manually. It was changed by the scripts I ran. Should I manually edit it? What is missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source