After upgrade from angular 12 to 13 incremental build is "defect"

Viewed 164

I am completely desperate cause every small change in e.g. .html (enter a space and save) results in complete build which last 2-4 minutes. It seem that something prevent that only a incremental build is running.

In angular 12 the incremental build last 2-5 seconds.

I develop with vscode on a windows machine.

package.json

  "name": "XXX",
  "version": "0.1.0",
  "description": "XXX",
  "author": "XXX",
  "builddate": "?",
  "scripts": {
    "ng": "ng",
    "start": "ng serve --port 4311 --configuration development",
    "build": "ng build ",
    "test": "ng test",
    "test-debug": "ng test --browsers ChromeDebug",
    "lint": "eslint -c .eslintrc.js --ext .ts src",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "13.2.0",
    "@angular/cdk": "13.2.0",
    "@angular/common": "13.2.0",
    "@angular/compiler": "13.2.0",
    "@angular/core": "13.2.0",
    "@angular/forms": "13.2.0",
    "@angular/localize": "13.2.0",
    "@angular/platform-browser": "13.2.0",
    "@angular/platform-browser-dynamic": "13.2.0",
    "@angular/router": "13.2.0",
    "@fortawesome/angular-fontawesome": "0.10.1",
    "@fortawesome/fontawesome-svg-core": "1.3.0",
    "@fortawesome/pro-light-svg-icons": "6.0.0",
    "@fortawesome/pro-solid-svg-icons": "6.0.0",
    "@ng-stack/forms": "2.4.0",
    "@ngx-translate/core": "14.0.0",
    "@ngx-translate/http-loader": "7.0.0",
    "@progress/kendo-angular-buttons": "7.0.2",
    "@progress/kendo-angular-charts": "6.0.0",
    "@progress/kendo-angular-common": "2.0.2",
    "@progress/kendo-angular-dateinputs": "6.0.1",
    "@progress/kendo-angular-dialog": "6.0.1",
    "@progress/kendo-angular-dropdowns": "6.0.1",
    "@progress/kendo-angular-excel-export": "4.0.3",
    "@progress/kendo-angular-grid": "6.0.3",
    "@progress/kendo-angular-icons": "1.0.0",
    "@progress/kendo-angular-indicators": "1.1.2",
    "@progress/kendo-angular-inputs": "8.0.5",
    "@progress/kendo-angular-intl": "3.1.2",
    "@progress/kendo-angular-l10n": "3.0.3",
    "@progress/kendo-angular-label": "3.1.2",
    "@progress/kendo-angular-layout": "6.5.0",
    "@progress/kendo-angular-listview": "3.0.0",
    "@progress/kendo-angular-menu": "3.0.4",
    "@progress/kendo-angular-messages": "1.32.2",
    "@progress/kendo-angular-navigation": "1.1.4",
    "@progress/kendo-angular-notification": "3.0.4",
    "@progress/kendo-angular-pager": "3.0.1",
    "@progress/kendo-angular-pdf-export": "3.0.3",
    "@progress/kendo-angular-popup": "4.0.4",
    "@progress/kendo-angular-progressbar": "2.0.3",
    "@progress/kendo-angular-sortable": "4.0.5",
    "@progress/kendo-angular-toolbar": "5.0.0",
    "@progress/kendo-angular-tooltip": "3.1.5",
    "@progress/kendo-angular-treelist": "4.0.3",
    "@progress/kendo-angular-treeview": "6.0.0",
    "@progress/kendo-angular-typography": "1.2.0",
    "@progress/kendo-angular-upload": "8.0.0",
    "@progress/kendo-data-query": "1.5.5",
    "@progress/kendo-drawing": "1.16.2",
    "@progress/kendo-licensing": "1.2.2",
    "@progress/kendo-svg-icons": "0.1.2",
    "@progress/kendo-theme-material": "5.2.0",
    "@tailwindcss/forms": "0.4.0",
    "@tailwindcss/typography": "0.5.1",
    "angular-oauth2-oidc": "13.0.1",
    "angular-svg-icon": "13.0.0",
    "moment": "2.29.1",
    "rxjs": "7.5.2",
    "tslib": "2.3.1",
    "zone.js": "0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "13.2.5",
    "@angular-eslint/builder": "13.1.0",
    "@angular-eslint/eslint-plugin": "13.1.0",
    "@angular-eslint/eslint-plugin-template": "13.1.0",
    "@angular-eslint/schematics": "13.1.0",
    "@angular-eslint/template-parser": "13.1.0",
    "@angular/cli": "13.2.1",
    "@angular/compiler-cli": "13.2.0",
    "@angular/language-service": "13.2.0",
    "@angular/localize": "13.2.0",
    "@types/jasmine": "3.6.2",
    "@types/jasminewd2": "2.0.8",
    "@types/node": "14.14.10",
    "@typescript-eslint/eslint-plugin": "5.11.0",
    "@typescript-eslint/eslint-plugin-tslint": "4.12.0",
    "@typescript-eslint/parser": "5.11.0",
    "codelyzer": "6.0.1",
    "eslint": "^8.2.0",
    "eslint-plugin-import": "2.22.1",
    "eslint-plugin-jsdoc": "30.7.13",
    "eslint-plugin-prefer-arrow": "1.2.2",
    "jasmine-core": "3.6.0",
    "jasmine-spec-reporter": "6.0.0",
    "karma": "6.3.9",
    "karma-chrome-launcher": "3.1.0",
    "karma-coverage": "2.1.0",
    "karma-jasmine": "4.0.1",
    "karma-jasmine-html-reporter": "1.5.4",
    "protractor": "7.0.0",
    "tailwindcss": "3.0.15",
    "ts-node": "9.1.1",
    "typescript": "4.5.4"
  }
}

angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "param-db": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/silent-refresh.html"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": false
            },
            "development": {
              "optimization": false,
              "outputHashing": "none",
              "sourceMap": true,
              "namedChunks": true,
              "extractLicenses": true,
              "vendorChunk": true,
              "buildOptimizer": false
            }
          },
          "defaultConfiguration": "development"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "param-db:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "param-db:build:production"
            },
            "development": {
              "browserTarget": "param-db:build:development"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "param-db:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "param-db:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "param-db:serve:production"
            },
            "development": {
              "devServerTarget": "param-db:serve:development"
            }
          }
        },
        "lint": {
          "builder": "@angular-eslint/builder:lint",
          "options": {
            "lintFilePatterns": [
              "src/**/*.ts",
              "src/**/*.html"
            ]
          }
        }
      }
    }
  },
  "defaultProject": "param-db",
  "cli": {
    "warnings": {
      "versionMismatch": true
    },
    "defaultCollection": "@angular-eslint/schematics"
  }
}

Please let me know if more information is needed.

Thanks in advance!

1 Answers

It seems I found the problem.

In my styles.scss I included another .scss with my kendo styles for the components I use, like it is described here kendo styling .

I changed this back, and use the import for all components @import "~@progress/kendo-theme-material/dist/all.scss";

Now my compile time is between 5-7 seconds instead of > 90 sec.

Related